$property; } /** * Magic setter to save protected properties. * @param string $property * @param mixed $value */ public function __set($property, $value) { $this->$property = $value; } /** * Convert the object to an array. * @param array $expand * @return array */ public function toArray(array $expand = array('repeaterTemplate')) { return array( 'id' => $this->id, 'name' => $this->name, 'subject' => $this->subject, 'tags' => $this->tags, 'emailTemplate' => $this->emailTemplate, 'smsTemplate' => $this->smsTemplate, 'repeaterTemplate' => in_array('repeaterTemplate', $expand) && !is_null($this->repeaterTemplate) ? $this->repeaterTemplate->toArray($expand) : null ); } /** * Populate from an array. * @param array $data */ public function fromArray($data = array()) { isset($data['id']) && $this->id = $data['id']; isset($data['name']) && $this->name = $data['name']; isset($data['subject']) && $this->subject = $data['subject']; isset($data['tags']) && $this->tags = $data['tags']; isset($data['emailTemplate']) && $this->emailTemplate = $data['emailTemplate']; isset($data['smsTemplate']) && $this->smsTemplate = $data['smsTemplate']; isset($data['repeaterTemplate']) && $this->repeaterTemplate = $data['repeaterTemplate']; } }