/** * Every time a row is created these fields should be populated with default values. */ public function save() { $primary = $this->getPrimaryColumn(); $raw = $primary["raw"]; if (empty($this->{$raw})) { $this->setCreated(date("Y-m-d H:i:s")); } $this->setModified(date("Y-m-d H:i:s")); parent::save(); }
public function save() { $primary = $this->getPrimaryColumn(); $raw = $primary['raw']; if (empty($this->{$raw})) { $this->setCreated(date("Y-m-d H:i:s")); $this->setDeleted(false); $this->setLive(true); } $this->setModified(date("Y-m-d H:i:s")); parent::save(); }