date_create = new DateTime(); $this->customers = new ArrayCollection(); $this->tag_details = []; } public function getID() { return $this->id; } public function setID($id) { $this->id = $id; return $this; } public function setName($name) { $this->name = $name; return $this; } public function getName() { return $this->name; } public function getDateCreate() { return $this->date_create; } public function addCustomer(Customer $customer) { $this->customers[$customer->getID()] = $customer; return $this; } public function clearCustomers() { $this->customers->clear(); return $this; } public function getCustomers() { return $this->customers; } public function removeCustomer(Customer $customer) { $this->customers->removeElement($customer); } public function addTagDetails($id, $value) { $this->tag_details[$id] = $value; return $this; } public function setTagDetails($tag_details) { $this->tag_details = $tag_details; return $this; } public function getTagDetails($id) { // return null if we don't have it if (!isset($this->tag_details[$id])) return null; return $this->tag_details[$id]; } public function getAllTagDetails() { return json_encode($this->tag_details); } }