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/sale/lib/exchange/integration/rest/ |
Upload File : |
<?php namespace Bitrix\Sale\Exchange\Integration\Rest; use Bitrix\Main\Error; use Bitrix\Main\Localization\Loc; use Bitrix\Sale\Exchange\Integration; Loc::loadMessages(__FILE__); class Sender { protected $fields; public function __construct() { $this->fields = new \Bitrix\Sale\Internals\Fields( \Bitrix\Main\Context::getCurrent()->getRequest()->toArray()); } /** * @return \Bitrix\Sale\Internals\Fields */ protected function getFields() { return $this->fields; } public function getField($name) { return isset($this->fields[$name]) ? $this->fields[$name]:''; } public function checkFields() { $r = new \Bitrix\Sale\Result(); if(empty($this->getField('orderIds'))) { $r->addError(new Error(Loc::getMessage('SALE_ORDER_REQUEST_ORDER_IDS_EMPTY'))) ; } if(empty($this->getField('entityId'))) { $r->addError(new Error(Loc::getMessage('SALE_ORDER_REQUEST_ENTITY_ID_EMPTY'))) ; } if(empty($this->getField('entityTypeId'))) { $r->addError(new Error(Loc::getMessage('SALE_ORDER_REQUEST_ENTITY_TYPE_ID_EMPTY'))); } elseif(Integration\CRM\EntityType::isDefined($this->getField('entityTypeId')) == false) { $r->addError(new Error(Loc::getMessage('SALE_ORDER_REQUEST_ENTITY_TYPE_ID_UNKNOW'))) ; } return $r; } }