$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() { is_null($this->profile) && $this->profile = \Utility\Registry::resolveProfileContext($this->profile); } /** * 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['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['reply'])) && $data['reply'] = $this->reply; return $data; } /** * Populate from an array. * @param array $data */ public function fromArray($data = array()) { isset($data['id']) && $this->id = $data['id']; isset($data['question']) && $this->question = $data['question']; isset($data['profile']) && $this->profile = $data['profile']; isset($data['reply']) && $this->reply = $data['reply']; } }