ValidatorAwareTrait (class)

Trait ValidatorAwareTrait

A trait that provides methods for building and interacting with Validators.

This trait is useful when building ORM like features where the implementing class wants to build and customize a variety of validator instances.

This trait expects that classes including it define two constants:

  • DEFAULT_VALIDATOR - The default validator name.
  • `VALIDATOR_PROVIDER_NAME ` - The provider name the including class is assigned in validators.

If the including class also implements events the Model.buildValidator event will be triggered when validators are created.

Direct Known Users

Cake\ORM\Table