/** * 入库前自动处理 */ public function beforeSave() { parent::beforeSave(); $this->tags && ($this->tags = str_replace(array(',', ', ', ' ,', ' '), ',', $this->tags)); $this->title_alias && ($this->title_alias = str_replace(array(' ', ', ', ' ,'), '-', $this->title_alias)); return true; }
/** * 返回指定的AR类的静态模型. * Please note that you should have this exact method in all your CActiveRecord descendants! * @param string $className active record class name. * @return SendTpl the static model class */ public static function model($className = __CLASS__) { return parent::model($className); }
public function beforeSave() { $this->password = $this->hashPassword($this->password); return parent::beforeSave(); }
/** * 入库前自动处理 */ public function beforeSave() { parent::beforeSave(); return true; }