public function beforeSave()
 {
     if (is_null(Yii::app()->db->getCurrentTransaction())) {
         throw new CException("transaction not found, use StatementLog->save() in transaction. And first lock site_company by id with FOR UPDATE.See Statement::updateDBByData");
     }
     return parent::beforeSave();
 }
 public function beforeSave()
 {
     if ($this->isNewRecord) {
         $this->deleted_status_date = new CDbExpression('NOW()');
     }
     return parent::beforeSave();
 }
Beispiel #3
0
 public function beforeSave()
 {
     //$this->added = date('Y-m-d H:i:s');
     //$this->user_id = Yii::app()->user->id;
     if (is_null(Yii::app()->db->getCurrentTransaction())) {
         throw new CException("transaction not found, use Statement->save() in transaction. And first lock site_company by id with FOR UPDATE. See Statement::updateDBByData");
     }
     return parent::beforeSave();
 }
Beispiel #4
0
 protected function beforeSave()
 {
     if (parent::beforeSave()) {
         $text = $this->message;
         $text = strip_tags($text, '<p><ul><ol><li><h><b><a><br><span><div>');
         $text = preg_replace('/<([a-zA-Z]+)([^\\x00]*?)>/u', '<$1>', $text);
         $text = str_replace('<br>', '<br />', $text);
         $this->message = $text;
         return true;
     }
     return false;
 }