示例#1
0
 /**
  * Does this field need validation?
  * This will return True only if the field has not already generated an error and it has content.
  * Descendents use this function to determine whether to continue validation or not.
  * @param FORM $form
  * @return boolean
  */
 public function continue_validating($form)
 {
     return !$this->is_empty() && !$form->num_errors($this->id);
 }
 /**
  * Are there errors or values for these fields?
  * @param FORM $form
  * @return boolean
  */
 public function needs_visible($form)
 {
     /** @var $date_before DATE_TIME */
     $date_before = $form->value_for($this->before_name());
     /** @var $date_after DATE_TIME */
     $date_after = $form->value_for($this->after_name());
     return $date_before->is_valid() || $form->num_errors($this->before_name()) || $date_after->is_valid() || $form->num_errors($this->after_name()) || $form->value_for($this->search_type_name()) != Search_date_constant;
 }