Example #1
0
 public function populate(array $array = [])
 {
     if ($this->id === null && empty($array['id'])) {
         if (empty($array['createdDt'])) {
             $array['createdDt'] = date('Y-m-d H:i:s');
         }
     }
     parent::populate($array);
 }
Example #2
0
 public function populate(array $array = [])
 {
     if ($this->id === null && empty($array['id'])) {
         if (empty($array['createdDt'])) {
             $array['createdDt'] = date('Y-m-d H:i:s.u');
         }
     }
     if (isset($array['calculatedVars']) && is_array($array['calculatedVars'])) {
         $array['calculatedVars'] = json_encode($array['calculatedVars']);
     }
     return parent::populate($array);
 }
Example #3
0
 public function populate(array $array = [])
 {
     if ($this->id === null && empty($array['id'])) {
         if (empty($array['createdDt'])) {
             $array['createdDt'] = date('Y-m-d H:i:s');
         }
         if (isset($array['updatedDt'])) {
             unset($array['updatedDt']);
         }
     } elseif ($this->id !== null) {
         $array['updatedDt'] = date('Y-m-d H:i:s');
     }
     parent::populate($array);
 }
Example #4
0
 public function __construct(array $data, $assignee, $project)
 {
     parent::__construct($data);
     $this->assignee = $assignee;
     $this->project = $project;
 }