Class **Phalcon\\Validation** ============================= *extends* abstract class :doc:`Phalcon\\Di\\Injectable ` *implements* :doc:`Phalcon\\Events\\EventsAwareInterface `, :doc:`Phalcon\\Di\\InjectionAwareInterface ` Allows to validate data using custom or built-in validators Methods ------- public **setValidators** (*unknown* $validators) ... public **__construct** ([*unknown* $validators]) Phalcon\\Validation constructor public :doc:`Phalcon\\Validation\\Message\\Group ` **validate** ([*unknown* $data], [*unknown* $entity]) Validate a set of data according to a set of rules public :doc:`Phalcon\\Validation ` **add** (*unknown* $field, *unknown* $validator) Adds a validator to a field public :doc:`Phalcon\\Validation ` **rule** (*unknown* $field, *unknown* $validator) Alias of `add` method public :doc:`Phalcon\\Validation ` **rules** (*unknown* $field, *unknown* $validators) Adds the validators to a field public :doc:`Phalcon\\Validation ` **setFilters** (*unknown* $field, *unknown* $filters) Adds filters to the field public *mixed* **getFilters** ([*unknown* $field]) Returns all the filters or a specific one public *array* **getValidators** () Returns the validators added to the validation public *object* **getEntity** () Returns the bound entity public *array* **setDefaultMessages** ([*unknown* $messages]) Adds default messages to validators public *string* **getDefaultMessage** (*unknown* $type) Get default message for validator type public :doc:`Phalcon\\Validation\\Message\\Group ` **getMessages** () Returns the registered validators public **setLabels** (*unknown* $labels) Adds labels for fields public *string* **getLabel** (*unknown* $field) Get label for field public :doc:`Phalcon\\Validation ` **appendMessage** (*unknown* $message) Appends a message to the messages list public :doc:`Phalcon\\Validation ` **bind** (*unknown* $entity, *unknown* $data) Assigns the data to an entity The entity is used to obtain the validation values public *mixed* **getValue** (*unknown* $field) Gets the a value to validate in the array/object data source public **setDI** (*unknown* $dependencyInjector) inherited from Phalcon\\Di\\Injectable Sets the dependency injector public :doc:`Phalcon\\DiInterface ` **getDI** () inherited from Phalcon\\Di\\Injectable Returns the internal dependency injector public **setEventsManager** (*unknown* $eventsManager) inherited from Phalcon\\Di\\Injectable Sets the event manager public :doc:`Phalcon\\Events\\ManagerInterface ` **getEventsManager** () inherited from Phalcon\\Di\\Injectable Returns the internal event manager public **__get** (*unknown* $propertyName) inherited from Phalcon\\Di\\Injectable Magic method __get