![]() 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/amasty/base/Model/Import/Validation/ |
<?php /** * @author Amasty Team * @copyright Copyright (c) Amasty (https://www.amasty.com) * @package Magento 2 Base Package */ namespace Amasty\Base\Model\Import\Validation; use Amasty\Base\Model\Import\AbstractImport; class Validator implements ValidatorInterface { /** * @var \Magento\Framework\DataObject */ protected $validationData; public function __construct(\Magento\Framework\DataObject $validationData) { $this->validationData = $validationData; } /** * @var array */ protected $errors = []; /** * @var array */ protected $messageTemplates = [ ]; /** * @inheritdoc */ public function validateRow(array $rowData, $behavior) { return true; } /** * Usual behavior at the end of validation. Help function * * @return array|bool */ public function validateResult() { if ($this->errors) { return $this->errors; } return true; } /** * @inheritdoc */ public function getErrorMessages() { return $this->messageTemplates; } /** * @inheritDoc */ public function addRuntimeError($message, $level) { if (!isset($this->errors[AbstractImport::RUNTIME_ERRORS])) { $this->errors[AbstractImport::RUNTIME_ERRORS] = []; } $this->errors[AbstractImport::RUNTIME_ERRORS][(string)(__('<b>Error!</b> ')) . $message] = $level; return $this; } }