/**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $this->validate = Hash::merge($this->validate, array('subject' => array('notEmpty' => array('rule' => array('notEmpty'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Subject')))), 'content' => array('notEmpty' => array('rule' => array('notEmpty'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Content')))), 'reply_type' => array('inList' => array('rule' => array('inList', array(CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_TEXT, CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_SELECTION, CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_MULTIPLE_SELECTION)), 'message' => __d('net_commons', 'Invalid request.')), 'notEmptyChoices' => array('rule' => array('validateNotEmptyChoices'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Choice')))), 'is_room_targeted_flag' => array('notEmpty' => array('rule' => array('validateNotEmptyTargetUser'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Circular Target')))), 'opened_period_from' => array('notEmpty' => array('rule' => array('notEmpty'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Period'))), 'datetime' => array('rule' => array('datetime'), 'message' => __d('net_commons', 'Invalid request.'))), 'opened_period_to' => array('notEmpty' => array('rule' => array('notEmpty'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Period'))), 'datetime' => array('rule' => array('datetime'), 'message' => __d('net_commons', 'Invalid request.')), 'fromTo' => array('rule' => array('validateDatetimeFromTo', array('from' => $this->data['CircularNoticeContent']['opened_period_from'])), 'message' => __d('net_commons', 'Invalid request.'))), 'reply_deadline_set_flag' => array('boolean' => array('rule' => array('boolean'), 'message' => __d('net_commons', 'Pleas input boolean.')))));
     if ($this->data['CircularNoticeContent']['reply_deadline_set_flag']) {
         $this->validate = Hash::merge($this->validate, array('reply_deadline' => array('notEmpty' => array('rule' => array('notEmpty'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Reply Deadline'))), 'datetime' => array('rule' => array('datetime'), 'message' => __d('net_commons', 'Invalid request.')), 'between' => array('rule' => array('validateDatetimeBetween', array('from' => $this->data['CircularNoticeContent']['opened_period_from'], 'to' => $this->data['CircularNoticeContent']['opened_period_to'])), 'message' => __d('net_commons', 'Invalid request.')))));
     }
     return parent::beforeValidate($options);
 }
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $this->validate = Hash::merge($this->validate, $this->_getDefaultValidate());
     if ($this->data['CircularNoticeContent']['publish_start']) {
         $this->validate = Hash::merge($this->validate, array('publish_start' => array('notBlank' => array('rule' => array('notBlank'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Period'))), 'datetime' => array('rule' => array('datetime'), 'message' => __d('net_commons', 'Invalid request.')))));
     }
     if ($this->data['CircularNoticeContent']['publish_end']) {
         $this->validate = Hash::merge($this->validate, array('publish_end' => array('notBlank' => array('rule' => array('notBlank'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Period'))), 'datetime' => array('rule' => array('datetime'), 'message' => __d('net_commons', 'Invalid request.')), 'fromTo' => array('rule' => array('validateDatetimeFromTo', array('from' => $this->data['CircularNoticeContent']['publish_start'])), 'message' => __d('net_commons', 'Invalid request.')))));
     }
     if ($this->data['CircularNoticeContent']['use_reply_deadline']) {
         $this->validate = Hash::merge($this->validate, array('use_reply_deadline' => array('boolean' => array('rule' => array('boolean'), 'message' => __d('net_commons', 'Pleas input boolean.')))));
     }
     if ($this->data['CircularNoticeContent']['use_reply_deadline']) {
         $this->validate = Hash::merge($this->validate, array('reply_deadline' => array('notBlank' => array('rule' => array('notBlank'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Reply Deadline'))), 'datetime' => array('rule' => array('datetime'), 'message' => __d('net_commons', 'Invalid request.')), 'between' => array('rule' => array('validateDatetimeBetween', array('from' => $this->data['CircularNoticeContent']['publish_start'], 'to' => $this->data['CircularNoticeContent']['publish_end'])), 'message' => __d('circular_notices', 'Please input between circular period.')))));
     }
     return parent::beforeValidate($options);
 }
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $this->validate = Hash::merge($this->validate, array('value' => array('notEmpty' => array('rule' => array('notEmpty'), 'message' => __d('net_commons', 'Invalid request.'))), 'weight' => array('naturalNumber' => array('rule' => array('naturalNumber', true), 'message' => __d('net_commons', 'Invalid request.')))));
     return parent::beforeValidate($options);
 }
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $displayNumbers = array_keys(self::getDisplayNumberOptions());
     $this->validate = Hash::merge($this->validate, array('frame_key' => array('notEmpty' => array('rule' => array('notEmpty'), 'message' => __d('net_commons', 'Invalid request.'), 'required' => true)), 'display_number' => array('inList' => array('rule' => array('inList', $displayNumbers), 'message' => __d('net_commons', 'Invalid request.')))));
     return parent::beforeValidate($options);
 }
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $this->validate = Hash::merge($this->validate, array('reply_text_value' => array('notEmpty' => array('rule' => array('validateNotEmptyReplyValue'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('circular_notices', 'Answer Title'))))));
     return parent::beforeValidate($options);
 }
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $this->validate = Hash::merge($this->validate, array('frame_key' => array('notBlank' => array('rule' => array('notBlank'), 'message' => __d('net_commons', 'Invalid request.'), 'required' => true)), 'display_number' => array('number' => array('rule' => array('notBlank'), 'message' => __d('net_commons', 'Invalid request.'), 'required' => true))));
     return parent::beforeValidate($options);
 }
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $this->validate = Hash::merge($this->validate, array());
     return parent::beforeValidate($options);
 }
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     return parent::beforeValidate($options);
 }