/** * Since Validate tests to make sure certain fields have values, populate requirements here such as the modified timestamp * @return boolean from parent */ protected function beforeValidate() { if ($this->isNewRecord) { $this->datetime_cre = new CDbExpression('NOW()'); } $this->modified = new CDbExpression('NOW()'); return parent::beforeValidate(); }