$property; } /** * Magic setter to save protected properties. * @param string $property * @param mixed $value */ public function __set($property, $value) { $this->$property = $value; } /** * @ORM\PrePersist */ public function setCreateTime() { $this->created = new \DateTime("now"); } /** * @ORM\PreUpdate */ public function setUpdateTime() { $this->updated = new \DateTime("now"); } /** * Convert the object to an array. * @param array $expand * @param array $intersect * @return array */ public function toArray(array $expand = array('attachment'), array $intersect = array()) { $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat'); $includeAll = empty($intersect); $data = array(); ($includeAll || isset($intersect['id'])) && $data['id'] = $this->id; ($includeAll || isset($intersect['service'])) && $data['service'] = $this->service; ($includeAll || isset($intersect['request'])) && $data['request'] = $this->request; ($includeAll || isset($intersect['response'])) && $data['response'] = $this->response; ($includeAll || isset($intersect['status'])) && $data['status'] = $this->status; ($includeAll || isset($intersect['fromCompany'])) && $data['fromCompany'] = in_array('fromCompany', $expand) && !is_null($this->fromCompany) ? $this->fromCompany->toArray($expand, $intersect) : null; ($includeAll || isset($intersect['fromProfile'])) && $data['fromProfile'] = in_array('fromProfile', $expand) && !is_null($this->fromProfile) ? $this->fromProfile->toArray($expand, $intersect) : null; ($includeAll || isset($intersect['created'])) && $data['created'] = !is_null($this->created) ? $this->created->format($dateTimeFormat) : null; ($includeAll || isset($intersect['updated'])) && $data['updated'] = !is_null($this->updated) ? $this->updated->format($dateTimeFormat) : null; return $data; } /** * Populate from an array. * @param array $data */ public function fromArray($data = array()) { isset($data['id']) && $this->id = $data['id']; isset($data['service']) && $this->service = $data['service']; isset($data['request']) && $this->request = $data['request']; isset($data['response']) && $this->response = $data['response']; isset($data['status']) && $this->status = $data['status']; isset($data['fromCompany']) && $this->fromCompany = $data['fromCompany']; isset($data['fromProfile']) && $this->fromProfile = $data['fromProfile']; } }