/** * Overload the create method to auto-insert * the timestamp if one does not exist * * @return void * @author Sam de Freyssinet */ public function create() { if (!isset($this->_fields['created'])) { return parent::create(); } if ($this->created === NULL) { $this->created = time(); } return parent::create(); }