Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/yandex.market/lib/result/ |
Upload File : |
<?php namespace Yandex\Market\Result; use Yandex\Market; class Base { protected $isSuccess = true; /** @var Market\Error\Base[] */ protected $errors; /** @var Market\Error\Base[] */ protected $warnings; /** @var array|null */ protected $data; public function __construct() { $this->errors = []; $this->warnings = []; } public function isSuccess() { return $this->isSuccess; } /** * @deprecated * @noinspection PhpUnused * @noinspection PhpUnusedParameterInspection */ public function setErrorStrict($isStrict) { trigger_error('setErrorStrict deprecated', E_USER_WARNING); } /** * @deprecated * @noinspection PhpUnused */ public function isErrorStrict() { return true; } public function invalidate() { $this->isSuccess = false; } public function addError(Market\Error\Base $error) { $this->isSuccess = false; $this->errors[] = $error; } public function addErrors(array $errors) { $this->isSuccess = false; foreach ($errors as $error) { $this->errors[] = $error; } } public function getErrors() { return $this->errors; } public function getErrorMessages() { $result = []; foreach ($this->errors as $error) { $result[] = $error->getMessage(); } return $result; } /** * @return bool */ public function hasErrors() { return !empty($this->errors); } public function addWarning(Market\Error\Base $warning) { $this->warnings[] = $warning; } public function addWarnings(array $warnings) { foreach ($warnings as $warning) { $this->warnings[] = $warning; } } /** * @return Market\Error\Base[] */ public function getWarnings() { return $this->warnings; } /** * @return string[] */ public function getWarningMessages() { $result = []; foreach ($this->warnings as $warning) { $result[] = $warning->getMessage(); } return $result; } /** * @return bool */ public function hasWarnings() { return !empty($this->warnings); } /** * Sets data of the result. * @param array $data */ public function setData(array $data) { $this->data = $data; } /** * @return array|null */ public function getData() { return $this->data; } }