stock = new \Doctrine\Common\Collections\ArrayCollection(); } /** * 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; } /** * @ORM\PrePersist */ public function setCreateTime() { $this->created = new \DateTime("now"); } /** * Convert the object to an array. * @param array $expand * @param array $intersect * @return array */ public function toArray(array $expand = array(), array $intersect = array()) { $includeAll = empty($intersect); $data = array(); ($includeAll || isset($intersect['id'])) && $data['id'] = $this->id; ($includeAll || isset($intersect['stock'])) && $data['stock'] = $this->stock; ($includeAll || isset($intersect['dealdone'])) && $data['dealdone'] = $this->dealdone; ($includeAll || isset($intersect['dealnotdone'])) && $data['dealnotdone'] = $this->dealnotdone; ($includeAll || isset($intersect['tradecentre'])) && $data['tradecentre'] = $this->tradecentre; ($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'] = $this->created; return $data; } /** * Convert the object to an array for synchronization. * @return array */ public function toSynchArray() { return array( 'id' => $this->id, 'stock' => $this->stock, 'dealdone' => $this->dealdone, 'dealnotdone' => $this->dealnotdone, 'tradecentre' => $this->tradecentre, 'fromProfile' => $this->fromProfile, 'created' => $this->created ); } /** * Populate from an array. * @param array $data */ public function fromArray($data = array()) { isset($data['id']) && $this->id = $data['id']; isset($data['stock']) && $this->stock = $data['stock']; isset($data['dealdone']) && $this->dealdone = $data['dealdone']; isset($data['dealnotdone']) && $this->dealnotdone = $data['dealnotdone']; isset($data['tradecentre']) && $this->tradecentre = $data['tradecentre']; isset($data['fromProfile']) && $this->fromProfile = $data['fromProfile']; isset($data['created']) && $this->created = $data['created']; } }