![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/framework/Validation/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\Validation; /** * 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 * @since 101.0.7 */ class ValidationResult { /** * @var array */ private $errors = []; /** * @param array $errors */ public function __construct(array $errors) { $this->errors = $errors; } /** * @return bool * @since 101.0.7 */ public function isValid(): bool { return empty($this->errors); } /** * @return array * @since 101.0.7 */ public function getErrors(): array { return $this->errors; } }