$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['emailTo'])) && $data['emailTo'] = $this->emailTo; ($includeAll || isset($intersect['emailSubject'])) && $data['emailSubject'] = $this->emailSubject; ($includeAll || isset($intersect['emailBody'])) && $data['emailBody'] = $this->emailBody; ($includeAll || isset($intersect['smsTo'])) && $data['smsTo'] = $this->smsTo; ($includeAll || isset($intersect['smsBody'])) && $data['smsBody'] = $this->smsBody; ($includeAll || isset($intersect['apiMsgId'])) && $data['apiMsgId'] = $this->apiMsgId; ($includeAll || isset($intersect['smsStatus'])) && $data['smsStatus'] = $this->smsStatus; ($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['toCompany'])) && $data['toCompany'] = in_array('toCompany', $expand) && !is_null($this->toCompany) ? $this->toCompany->toArray($expand, $intersect) : null; ($includeAll || isset($intersect['toProfile'])) && $data['toProfile'] = in_array('toProfile', $expand) && !is_null($this->toProfile) ? $this->toProfile->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['emailTo']) && $this->emailTo = $data['emailTo']; isset($data['emailSubject']) && $this->emailSubject = $data['emailSubject']; isset($data['emailBody']) && $this->emailBody = $data['emailBody']; isset($data['smsTo']) && $this->smsTo = $data['smsTo']; isset($data['smsBody']) && $this->smsBody = $data['smsBody']; isset($data['apiMsgId']) && $this->apiMsgId = $data['apiMsgId']; isset($data['smsStatus']) && $this->smsStatus = $data['smsStatus']; isset($data['fromCompany']) && $this->fromCompany = $data['fromCompany']; isset($data['fromProfile']) && $this->fromProfile = $data['fromProfile']; isset($data['toCompany']) && $this->toCompany = $data['toCompany']; isset($data['toProfile']) && $this->toProfile = $data['toProfile']; } }