From 6398c58b3205924bb833f7df67c6eef21a14390f Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 27 Aug 2019 06:10:36 +0000 Subject: [PATCH] Add privacy policy field to warranty. Add getter and setter and method to check for privacy policy in Warranty. #256 --- src/Entity/Warranty.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/Entity/Warranty.php b/src/Entity/Warranty.php index 1cfa242c..49fa7f30 100644 --- a/src/Entity/Warranty.php +++ b/src/Entity/Warranty.php @@ -127,6 +127,13 @@ class Warranty */ protected $flag_activated; + // privacy policy + /** + * @ORM\OneToOne(targetEntity="PrivacyPolicy") + * @ORM\JoinColumn(name="warranty_privacy_policy", referencedColumnName="id", nullable=true) + */ + protected $privacy_policy; + public function __construct() { $this->date_create = new DateTime(); @@ -366,4 +373,23 @@ class Warranty { return $this->flag_activated; } + + public function hasPrivacyPolicy() + { + if ($this->privacy_policy == null) + return false; + + return true; + } + + public function setPrivacyPolicy(PrivacyPolicy $privacy_policy) + { + $this->privacy_policy = $privacy_policy; + return $this; + } + + public function getPrivacyPolicy() + { + return $this->privacy_policy; + } }