public function beforeSave($insert) { if (parent::beforeSave($insert)) { $this->created_at = time(); return true; } else { return false; } }
protected function setUp() { static::$params = (require __DIR__ . '/data/config.php'); parent::setUp(); BaseRecord::$db = $this->getConnection(); }
public function afterSave($insert, $changedAttributes) { DynamicActiveRecordTest::$afterSaveInsert = $insert; DynamicActiveRecordTest::$afterSaveNewRecord = $this->isNewRecord; parent::afterSave($insert, $changedAttributes); }