$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->company = \Utility\Registry::resolveCompanyContext($this->company); $this->profile = \Utility\Registry::resolveProfileContext($this->profile); $this->created = new \DateTime("now"); } /** * Convert the object to an array. * @param array $expand * @param array $intersect * @param boolean $showIdentifiers * @param integer $expandAll * @return array */ public function toArray( array $expand = array(), array $intersect = array(), $showIdentifiers = false, $expandAll = 0 ) { $intersect = array_flip($intersect); $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat'); $includeAll = empty($intersect); $data = array(); ($includeAll || isset($intersect['id'])) && $data['id'] = $this->id; ($includeAll || isset($intersect['auction'])) && $data['auction'] = (in_array('auction', $expand) || $expandAll || $showIdentifiers) && !is_null($this->auction) ? (!$showIdentifiers ? $this->auction->toArray( $expand, $intersect, $showIdentifiers, ($expandAll - 1) ) : $this->auction->id) : null; ($includeAll || isset($intersect['company'])) && $data['company'] = (in_array('company', $expand) || $expandAll || $showIdentifiers) && !is_null($this->company) ? (!$showIdentifiers ? $this->company->toArray( $expand, $intersect, $showIdentifiers, ($expandAll - 1) ) : $this->company->id) : null; ($includeAll || isset($intersect['profile'])) && $data['profile'] = (in_array('profile', $expand) || $expandAll || $showIdentifiers) && !is_null($this->profile) ? (!$showIdentifiers ? $this->profile->toArray( $expand, $intersect, $showIdentifiers, ($expandAll - 1) ) : $this->profile->id) : null; ($includeAll || isset($intersect['amount'])) && $data['amount'] = $this->amount; ($includeAll || isset($intersect['status'])) && $data['status'] = $this->status; ($includeAll || isset($intersect['created'])) && $data['created'] = !is_null($this->created) ? $this->created->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['auction']) && $this->auction = $data['auction']; isset($data['company']) && $this->company = $data['company']; isset($data['profile']) && $this->profile = $data['profile']; isset($data['amount']) && $this->amount = $data['amount']; isset($data['status']) && $this->status = $data['status']; } }