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); }
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); }
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); }