* @package tao */ class tao_helpers_form_validators_NotEmpty extends tao_helpers_form_Validator { /** * Short description of method evaluate * * @access public * @author Joel Bout, * @param mixed $values * @return bool */ public function evaluate($values) { if (is_string($values)) { return !empty(trim($values)); } if (is_array($values)) { return count($values) >= 1; } return is_scalar($values); } protected function getDefaultMessage() { return __('This field is required'); } }