public function beforeValidate() { parent::beforeValidate(); $this->user_id = Yii::app()->user->id; $this->createtime = time(); return true; }
public function beforeValidate() { if ($this->isNewRecord) { $this->timestamp = time(); } return parent::beforeValidate(); }
public function beforeValidate() { if ($this->isNewRecord) { $this->user_id = Yii::app()->user->id; $this->order_date = time(); } return parent::beforeValidate(); }
public function beforeValidate() { if(parent::beforeValidate()) { $this->timestamp = time(); $to_user = YumUser::model()->findByPk($this->to_user_id); if($to_user && isset($to_user->privacy)) { if(in_array($this->from_user->username, $to_user->privacy->getIgnoredUsers())) $this->addError('to_user_id', Yum::t('One of the recipients ({username}) has ignored you. Message will not be sent!', array('{username}' => $to_user->username))); } return true; } return false; }
public function beforeValidate() { $this->ignore_users = trim(strtr($this->ignore_users, array(', ' => ','))); if (!isset($this->message_new_friendship) || is_null($this->message_new_friendship)) { $this->message_new_friendship = true; } if (!isset($this->message_new_message) || is_null($this->message_new_message)) { $this->message_new_message = true; } if (!isset($this->message_new_profilecomment) || is_null($this->message_new_profilecomment)) { $this->message_new_profilecomment = true; } return parent::beforeValidate(); }
public function beforeValidate() { $this->jointime = time(); return parent::beforeValidate(); }