$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"); } public function fromArray($data) { isset($data['company']) && $this->company = $data['company']; isset($data['firstName']) && $this->firstName = $data['firstName']; isset($data['familyName']) && $this->familyName = $data['familyName']; isset($data['idNumber']) && $this->idNumber = $data['idNumber']; } public function toArray() { $dateTimeFormat = \Utility\Definitions\Locale::getDateTimeFormat(); $data = array(); $data['company'] = $this->company; $data['firstName'] = $this->firstName; $data['familyName'] = $this->familyName; $data['idNumber'] = $this->idNumber; $data['created'] = $this->created->format($dateTimeFormat); $data['updated'] = !is_null($this->updated) ? $this->updated->format($dateTimeFormat) : ''; return $data; } }