methodDetails = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Add detail entry for this method. * @param Town $town * @return \Location\Entity\Region */ public function addDetail(FoundMethodDetail $methodDetail) { $this->methodDetails[] = $methodDetail; return $this; } /** * Magic getter to expose protected properties. * @param string $property * @return mixed */ public function __get($property) { return $this->$property; } /** * Magic setter to save protected properties. * @param string $property * @param mixed $value */ public function __set($property, $value) { $this->$property = $value; } /** * Convert the object to an array. * @param array $expand * @param array $intersect * @return array */ public function toArray(array $expand = array(), array $intersect = array()) { $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat'); $includeAll = empty($intersect); $data = array(); ($includeAll || isset($intersect['id'])) && $data['id'] = $this->id; ($includeAll || isset($intersect['name'])) && $data['name'] = $this->name; return $data; } /** * Populate from an array. * @param array $data */ public function fromArray($data = array()) { isset($data['id']) && $this->id = $data['id']; isset($data['name']) && $this->name = $data['name']; } }