public function save($flush = true) { $curTime = time(); if ($this->created_at <= 0) { $this->created_at = $curTime; } $this->modified_at = $curTime; parent::save($flush); }