Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
ValidatorsManager Class Reference

Validators manager. More...

+ Inheritance diagram for ValidatorsManager:

Static Public Member Functions

static start ()
 
static getCacheInfo ($model)
 
static validate ($instance, $group='', $excludedValidators=[])
 Validates an instance.
 
static getUIConstraints ($instance, $group='', $excludedValidators=[])
 Returns an array of UI rules for Javascript validation.
 
static validateInstances ($instances, $group='')
 Validates an array of objects.
 
- Static Public Member Functions inherited from ValidatorsManagerInitTrait
static initModelsValidators (&$config, $databaseOffset='default')
 Parses models and save validators in cache to use in dev only.
 
static initClassValidators ($class)
 Parses a class and save validators in cache to use in dev only.
 
static addClassValidators ($class)
 Parses a class and save validators in cache.
 
static registerType ($type, $validatorClass)
 Registers a validator type for using with @validator annotation.
 
- Static Public Member Functions inherited from ValidatorsManagerCacheTrait
static clearCache ($model=null, $group='')
 
static initCacheInstanceValidators ($instance, $group='')
 Initializes the cache (SessionCache) for the class of instance.
 

Static Public Attributes

static $validatorTypes
 

Static Protected Member Functions

static getGroupArrayValidators (array $validators, $group)
 
static getGroupMemberValidators (array $validators, $group)
 
static validateInstances_ ($instances, $members)
 
static validate_ ($instance, $members, $excludedValidators=[])
 
static getUIConstraints_ ($instance, $members, $excludedValidators=[])
 
- Static Protected Member Functions inherited from ValidatorsManagerCacheTrait
static getClassCacheValidators ($class, $group='')
 
static getHash ($class)
 
static getModelCacheKey ($classname)
 
static store ($model, $validators)
 
static fetch ($model)
 
static validateFromCache_ ($instance, $members, $excludedValidators=[])
 
static getUIConstraintsFromCache_ ($instance, $members, $excludedValidators=[])
 
static initInstancesValidators ($instance, $members, $group='')
 
static getValidatorInstance ($type)
 

Static Protected Attributes

static $instanceValidators = [ ]
 
- Static Protected Attributes inherited from ValidatorsManagerCacheTrait
static $cache
 
static $key = 'contents/validators/'
 

Detailed Description

Validators manager.

Ubiquity\contents\validation$ValidatorsManager This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.4

Definition at line 45 of file ValidatorsManager.php.

Member Function Documentation

◆ getCacheInfo()

static getCacheInfo (   $model)
static

Definition at line 80 of file ValidatorsManager.php.

◆ getGroupArrayValidators()

static getGroupArrayValidators ( array  $validators,
  $group 
)
staticprotected

Definition at line 84 of file ValidatorsManager.php.

◆ getGroupMemberValidators()

static getGroupMemberValidators ( array  $validators,
  $group 
)
staticprotected

Definition at line 95 of file ValidatorsManager.php.

◆ getUIConstraints()

static getUIConstraints (   $instance,
  $group = '',
  $excludedValidators = [ ] 
)
static

Returns an array of UI rules for Javascript validation.

Parameters
$instance
string$group
array$excludedValidators
Returns
array

Definition at line 134 of file ValidatorsManager.php.

◆ getUIConstraints_()

static getUIConstraints_ (   $instance,
  $members,
  $excludedValidators = [ ] 
)
staticprotected

Definition at line 207 of file ValidatorsManager.php.

◆ start()

static start ( )
static

Definition at line 48 of file ValidatorsManager.php.

◆ validate()

static validate (   $instance,
  $group = '',
  $excludedValidators = [ ] 
)
static

Validates an instance.

Parameters
object$instance
string$group
array$excludedValidators
Returns
\Ubiquity\contents\validation\validators\ConstraintViolation[]

Definition at line 114 of file ValidatorsManager.php.

◆ validate_()

static validate_ (   $instance,
  $members,
  $excludedValidators = [ ] 
)
staticprotected

Definition at line 184 of file ValidatorsManager.php.

◆ validateInstances()

static validateInstances (   $instances,
  $group = '' 
)
static

Validates an array of objects.

Parameters
array$instances
string$group
Returns
\Ubiquity\contents\validation\validators\ConstraintViolation[]

Definition at line 154 of file ValidatorsManager.php.

◆ validateInstances_()

static validateInstances_ (   $instances,
  $members 
)
staticprotected

Definition at line 169 of file ValidatorsManager.php.

Field Documentation

◆ $instanceValidators

$instanceValidators = [ ]
staticprotected

Definition at line 46 of file ValidatorsManager.php.

◆ $validatorTypes

$validatorTypes
static
Initial value:
= [
'notNull' => NotNullValidator::class,
'isNull' => IsNullValidator::class,
'notEmpty' => NotEmptyValidator::class,
'isEmpty' => IsEmptyValidator::class,
'isTrue' => IsTrueValidator::class,
'isFalse' => IsFalseValidator::class,
'isBool' => IsBooleanValidator::class,
'equals' => EqualsValidator::class,
'type' => TypeValidator::class,
'greaterThan' => GreaterThanValidator::class,
'greaterThanOrEqual' => GreaterThanOrEqualValidator::class,
'lessThan' => LessThanValidator::class,
'lessThanOrEqual' => LessThanOrEqualValidator::class,
'length' => LengthValidator::class,
'id' => IdValidator::class,
'regex' => RegexValidator::class,
'email' => EmailValidator::class,
'url' => UrlValidator::class,
'ip' => IpValidator::class,
'range' => RangeValidator::class,
'date' => DateValidator::class,
'dateTime' => DateTimeValidator::class,
'time' => TimeValidator::class,
'match'=>MatchWithValidator::class
]

Definition at line 51 of file ValidatorsManager.php.


The documentation for this class was generated from the following file: