/** * @param AbstractField $field * @return bool */ public function isValid(AbstractField $field) { if ($field instanceof CheckboxField) { return $field->getValue(); } return false; }
/** * @param AbstractField $field * @return bool */ public function isValid(AbstractField $field) { $value = $field->getValue(); if (is_string($value)) { $value = trim($value); } return !empty($value); }
/** * @param AbstractField $field * @return bool */ public function isValid(AbstractField $field) { $value = $field->getValue(); if ($this->min !== null) { if ($this->inclusive == true && !(strlen($value) >= $this->min) || $this->inclusive == false && !(strlen($value) > $this->min)) { return false; } } if ($this->max !== null) { if ($this->inclusive == true && !(strlen($value) <= $this->max) || $this->inclusive == false && !(strlen($value) < $this->max)) { return false; } } return true; }
/** * @param AbstractField $field * @return bool */ public function isValid(AbstractField $field) { $result = $this->client->checkVat(array('countryCode' => (string) $this->countryCode, 'vatNumber' => (int) $field->getValue())); return $result->valid; }
/** * @param AbstractField $field * @return bool */ public function isValid(AbstractField $field) { return filter_var($field->getValue(), FILTER_VALIDATE_EMAIL); }
/** * @param AbstractField $field * @return bool */ public function isValid(AbstractField $field) { return is_numeric($field->getValue()); }