Add relationship between job order and subscription for tagging #799
This commit is contained in:
parent
3ed65e7fc6
commit
8c83393b0c
2 changed files with 30 additions and 0 deletions
|
|
@ -441,6 +441,13 @@ class JobOrder
|
||||||
*/
|
*/
|
||||||
protected $flag_cust_new;
|
protected $flag_cust_new;
|
||||||
|
|
||||||
|
// get the subscription this job order is associated with
|
||||||
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity="Subscription", inversedBy="claims")
|
||||||
|
* @ORM\JoinColumn(name="subscription_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
|
||||||
|
*/
|
||||||
|
protected $subscription;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->date_create = new DateTime();
|
$this->date_create = new DateTime();
|
||||||
|
|
@ -1256,4 +1263,15 @@ class JobOrder
|
||||||
return $this->flag_cust_new;
|
return $this->flag_cust_new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSubscription()
|
||||||
|
{
|
||||||
|
return $this->subscription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSubscription($subscription)
|
||||||
|
{
|
||||||
|
$this->subscription = $subscription;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,12 @@ class Subscription
|
||||||
*/
|
*/
|
||||||
protected $customer_vehicle;
|
protected $customer_vehicle;
|
||||||
|
|
||||||
|
// job orders associated with subscription
|
||||||
|
/**
|
||||||
|
* @ORM\OneToMany(targetEntity="JobOrder", mappedBy="subscription")
|
||||||
|
*/
|
||||||
|
protected $job_orders;
|
||||||
|
|
||||||
// email address
|
// email address
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string", length=255, nullable=true)
|
* @ORM\Column(type="string", length=255, nullable=true)
|
||||||
|
|
@ -89,6 +95,7 @@ class Subscription
|
||||||
$this->date_start = null;
|
$this->date_start = null;
|
||||||
$this->date_end = null;
|
$this->date_end = null;
|
||||||
$this->date_cancel = null;
|
$this->date_cancel = null;
|
||||||
|
$this->job_orders = new ArrayCollection();
|
||||||
$this->metadata = [];
|
$this->metadata = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -207,6 +214,11 @@ class Subscription
|
||||||
return $this->metadata;
|
return $this->metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getJobOrders()
|
||||||
|
{
|
||||||
|
return $this->job_orders;
|
||||||
|
}
|
||||||
|
|
||||||
public function getGatewayTransactions()
|
public function getGatewayTransactions()
|
||||||
{
|
{
|
||||||
// TODO: get gateway transactions here via type and metadata
|
// TODO: get gateway transactions here via type and metadata
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue