Modify the association between Warranty and PrivacyPolicy to ManyToOne. Add getters and setters for warranty in PrivacyPolicy. #256
This commit is contained in:
parent
6398c58b32
commit
918f95e425
2 changed files with 20 additions and 4 deletions
|
|
@ -48,6 +48,16 @@ class PrivacyPolicy
|
|||
*/
|
||||
protected $cust_promo;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Warranty", mappedBy="privacy_policy")
|
||||
*/
|
||||
protected $warranties;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->warranties = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getID()
|
||||
{
|
||||
return $this->id;
|
||||
|
|
@ -108,9 +118,15 @@ class PrivacyPolicy
|
|||
return $this->cust_promo;
|
||||
}
|
||||
|
||||
public function addWarranty(Warranty $warranty)
|
||||
{
|
||||
$this->warranties[] = $warranty;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getWarrantiess()
|
||||
{
|
||||
return $this->warranties;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class Warranty
|
|||
|
||||
// privacy policy
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="PrivacyPolicy")
|
||||
* @ORM\ManyToOne(targetEntity="PrivacyPolicy", inversedBy="warranties")
|
||||
* @ORM\JoinColumn(name="warranty_privacy_policy", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
protected $privacy_policy;
|
||||
|
|
|
|||
Loading…
Reference in a new issue