PHP Class Webiny\Component\Entity\Attribute\Validation\ValidationException

Inheritance: extends Webiny\Component\StdLib\Exception\AbstractException, implements IteratorAggregate
Show file Open project: Webiny/Framework Class Usage Examples

Protected Properties

Property Type Description
$attribute
$errors
$messages

Public Methods

Method Description
addError ( string $key, string | integer $message, null | array $params = null ) Add error for given key
getIterator ( ) : Traversable Retrieve an external iterator
setAttribute ( null $attribute )
setMessage ( $message )

Method Details

addError() public method

This is useful when you are validating an array attribute which can have validators on every nested key. When validating a simple attribute with no nested values, use this method to set error message for the attribute itself.
public addError ( string $key, string | integer $message, null | array $params = null )
$key string Attribute name or nested attribute key
$message string | integer
$params null | array

getIterator() public method

Retrieve an external iterator
public getIterator ( ) : Traversable
return Traversable An instance of an object implementing Iterator or Traversable

setAttribute() public method

public setAttribute ( null $attribute )
$attribute null

setMessage() public method

public setMessage ( $message )

Property Details

$attribute protected property

protected $attribute

$errors protected property

protected $errors

$messages protected static property

protected static $messages