/** * This method is invoked after a user is saved * The default implementation raises the {@link onAfterRegister} and {@link onAfterSave} events. * @see CActiveRecord::afterSave() */ protected function afterSave() { if ($this->scenario == "register") { $this->afterRegister(); } parent::afterSave(); }
/** * Saves the resource file after the record is saved * @see CActiveRecord::afterSave() */ public function afterSave() { if (is_object($this->_uploadedFile)) { if (!$this->_uploadedFile->saveAs($this->fullPath)) { rename($this->_uploadedFile->tempName, $this->fullPath); } } elseif ($this->_content !== null) { file_put_contents($this->fullPath, $this->_content); } parent::afterSave(); }