Maslosoft Mangan API
Class RequiredValidatorAnnotation
RequiredValidator validates that the specified attribute does not have null or empty value.
When using the Maslosoft\Mangan\Annotations\Validators\ValidatorAnnotation::$message
property to define a custom error message, the message
may contain additional placeholders that will be replaced with the actual content. In addition
to the "{attribute}" placeholder, recognized by all validators (see Validator),
RequiredValidator allows for the following placeholders to be specified:
- {value}: replaced with the desired value
Maslosoft\Mangan\Annotations\Validators\RequiredValidatorAnnotation::$requiredValue
.
- Maslosoft\Addendum\Collections\MetaAnnotation
- Maslosoft\Mangan\Meta\ManganAnnotation
- Maslosoft\Mangan\Meta\ManganPropertyAnnotation
- Maslosoft\Mangan\Annotations\Validators\ValidatorAnnotation
- Maslosoft\Mangan\Annotations\Validators\RequiredValidatorAnnotation uses Maslosoft\Mangan\Validators\Traits\Strict, Maslosoft\Mangan\Validators\Traits\When
Package: system\validators
Author: Qiang Xue qiang.xue@gmail.com
Version: $Id$
Since: 1.0
Located at Annotations/Validators/RequiredValidatorAnnotation.php
Methods inherited from Maslosoft\Mangan\Meta\ManganPropertyAnnotation
Methods inherited from Maslosoft\Mangan\Meta\ManganAnnotation
Methods used from Maslosoft\Mangan\Validators\Traits\When
Constants summary
Constants inherited from Maslosoft\Mangan\Annotations\Validators\ValidatorAnnotation
Properties summary
public
mixed
|
$requiredValue
the desired value that the attribute must have. If this is null, the validator will validate that the specified attribute does not have null or empty value. If this is set as a value that is not null, the validator will validate that the attribute has a value that is the same as this property value. Defaults to null. |
#
NULL
|
Properties inherited from Maslosoft\Mangan\Annotations\Validators\ValidatorAnnotation
$class
,
$except
,
$message
,
$on
,
$proxy
,
$safe
,
$skipOnError
,
$value