Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
ValidationResult Class Reference

Public Member Functions

 __construct (array $errors)
 
 isValid ()
 
 getErrors ()
 

Detailed Description

ValidationResult object supposed to be created by dedicated validator service which makes a validation and checks whether all entity invariants (business rules that always should be fulfilled) are valid.

ValidationResult represents a container storing all the validation errors that happened during the entity validation.

@api

Definition at line 16 of file ValidationResult.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( array  $errors)
Parameters
array$errors

Definition at line 26 of file ValidationResult.php.

27  {
28  $this->errors = $errors;
29  }
$errors
Definition: overview.phtml:9

Member Function Documentation

◆ getErrors()

getErrors ( )
Returns
array

Definition at line 42 of file ValidationResult.php.

42  : array
43  {
44  return $this->errors;
45  }
$errors
Definition: overview.phtml:9

◆ isValid()

isValid ( )
Returns
bool

Definition at line 34 of file ValidationResult.php.

34  : bool
35  {
36  return empty($this->errors);
37  }

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