class SerializedConstraint
Checks for valid serialized data.
Attributes
#[Constraint(id: 'Serialized', label: new TranslatableMarkup('Serialized', [], [
'context' => 'Validation',
]))]
Hierarchy
- class \Drupal\Core\Validation\Plugin\Validation\Constraint\SerializedConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of SerializedConstraint
1 file declares its use of SerializedConstraint
- SerializedConstraintValidatorTest.php in core/
tests/ Drupal/ Tests/ Core/ Validation/ Plugin/ Validation/ Constraint/ SerializedConstraintValidatorTest.php
File
-
core/
lib/ Drupal/ Core/ Validation/ Plugin/ Validation/ Constraint/ SerializedConstraint.php, line 12
Namespace
Drupal\Core\Validation\Plugin\Validation\ConstraintView source
class SerializedConstraint extends SymfonyConstraint {
/**
* The default violation message.
*
* @var string
*/
public string $message = 'This value should be a serialized object.';
/**
* The violation message when the value is not a string.
*
* @var string
*/
public string $wrongTypeMessage = 'This value should be a string, "{type}" given.';
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| SerializedConstraint::$message | public | property | The default violation message. |
| SerializedConstraint::$wrongTypeMessage | public | property | The violation message when the value is not a string. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.