diff --git a/src/Entity/MobileSession.php b/src/Entity/MobileSession.php index 831d14fd..c36092ed 100644 --- a/src/Entity/MobileSession.php +++ b/src/Entity/MobileSession.php @@ -3,6 +3,9 @@ namespace App\Entity; use Doctrine\ORM\Mapping as ORM; + +use Doctrine\Common\Collections\ArrayCollection; + use DateTime; /** @@ -91,6 +94,12 @@ class MobileSession */ protected $date_code_sent; + // reviews made by mobile session + /** + * @ORM\OneToMany(targetEntity="Review", mappedBy="mobile_session") + */ + protected $reviews; + public function __construct() { @@ -101,6 +110,7 @@ class MobileSession $this->confirm_flag = false; $this->date_confirmed = null; $this->date_code_sent = null; + $this->reviews = new ArrayCollection(); } public function generateKeyID() @@ -239,4 +249,9 @@ class MobileSession { return $this->date_code_sent; } + + public function getReviews() + { + return $this->reviews; + } } diff --git a/src/Entity/Partner.php b/src/Entity/Partner.php new file mode 100644 index 00000000..d1908980 --- /dev/null +++ b/src/Entity/Partner.php @@ -0,0 +1,118 @@ +services = new ArrayCollection(); + $this->date_create = new DateTime(); + } + + public function getID() + { + return $this->id; + } + + public function setName($name) + { + $this->name = $name; + return $this; + } + + public function getName() + { + return $this->name; + } + + public function getDateCreate() + { + return $this->date_create; + } + + public function setCreatedBy(User $created_by) + { + $this->created_by = $created_by; + return $this; + } + + public function getCreatedBy() + { + return $this->created_by; + } + + public function addService(Service $service) + { + if (!isset($this->services[$service->getID()])) + unset($this->services[$service->getID()]); + return $this; + } + + public function removeService(Service $service) + { + if (isset($this->services[$service->getID()])) + unset($this->services[$service->getID()]); + return $this; + } + + public function clearServices() + { + $this->services->clear(); + return $this; + } + + public function getServices() + { + return $this->services; + } + +} diff --git a/src/Entity/Review.php b/src/Entity/Review.php new file mode 100644 index 00000000..57ee2c6f --- /dev/null +++ b/src/Entity/Review.php @@ -0,0 +1,117 @@ +date_create = new DateTime(); + $this->rating = 0; + $this->comment = ""; + } + + public function getID() + { + return $this->id; + } + + public function setPartner(Partner $partner) + { + $this->partner = $partner; + return $this; + } + + public function getPartner() + { + return $this->partner; + } + + public function setRating($rating) + { + $this->rating = $rating; + return $this; + } + + public function getRating() + { + return $this->rating; + } + + + public function setMessage($message) + { + $this->message = $message; + return $this; + } + + public function getMessage() + { + return $this->message; + } + + public function getDateCreate() + { + return $this->date_create; + } + + public function setMobileSession(MobileSession $mobile_session) + { + $this->mobile_session = $mobile_session; + return $this; + } + + public function getMobileSession() + { + return $this->mobile_session; + } + +} diff --git a/src/Entity/Service.php b/src/Entity/Service.php new file mode 100644 index 00000000..cc420e01 --- /dev/null +++ b/src/Entity/Service.php @@ -0,0 +1,76 @@ +partners = new ArrayCollection(); + } + + public function getID() + { + return $this->id; + } + + public function setName($name) + { + $this->name = $name; + return $this; + } + + public function getName() + { + return $this->name; + } + + public function addPartner(Partner $partner) + { + $this->partners[$partner->getID()] = $partner; + + return $this; + } + + public function clearPartners() + { + $this->partners->clear(); + return $this; + } + + public function getPartners() + { + return $this->partners; + } + +} diff --git a/src/Entity/User.php b/src/Entity/User.php index c7304ef3..a57afb97 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -104,6 +104,12 @@ class User extends BaseUser implements Serializable */ protected $invoices; + // partners made by this user + /** + * @ORM\OneToMany(targetEntity="Partner", mappedBy="created_by") + */ + protected $partners_created; + public function __construct() { parent::__construct(); @@ -112,6 +118,7 @@ class User extends BaseUser implements Serializable $this->job_orders_created = new ArrayCollection(); $this->job_orders_assigned = new ArrayCollection(); $this->tickets = new ArrayCollection(); + $this->partners_created = new ArrayCollection(); } public function getID() @@ -297,4 +304,9 @@ class User extends BaseUser implements Serializable { return $this->invoices; } + + public function getPartnersCreated() + { + return $this->partners_created; + } }