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/seo/lib/webhook/payload/ |
Upload File : |
<? /** * Bitrix Framework * @package bitrix * @subpackage seoproxy * @copyright 2001-2018 Bitrix */ namespace Bitrix\Seo\WebHook\Payload; /** * Class Payload * * @package Bitrix\Seo\WebHook\Payload */ class Batch { /** @var Item[] $items Items. */ protected $items = []; /** @var string $requestId Request ID. */ protected $requestId; /** @var string $source Source. */ protected $source; /** @var string $code Code. */ protected $code; /** @var string $externalId External ID. */ protected $externalId; /** * Set lead items array. * * @param array $items Items. * @return $this */ public function setLeadItemsArray(array $items) { foreach ($items as $item) { $this->addItem(new LeadItem($item)); } return $this; } /** * Set array. * * @param array $data * @return $this */ public function setArray(array $data) { $this->setRequestId($data['requestId']) ->setLeadItemsArray($data['items']) ->setCode($data['code']) ->setExternalId($data['externalId']) ->setSource($data['source']); return $this; } public function getArray() { return [ 'code' => $this->getCode(), 'externalId' => $this->getExternalId(), 'requestId' => $this->getRequestId(), 'items' => array_map( function ($item) { /** @var Item $item */ return $item->getData(); }, $this->getItems() ), 'source' => $this->getSource(), ]; } /** * Get item instances. * * @return Item[]|LeadItem[] */ public function getItems() { return $this->items; } /** * Add item. * * @param Item $item Item instance. * @return $this */ public function addItem(Item $item) { $this->items[] = $item; return $this; } /** * Get request ID. * * @return string */ public function getRequestId() { return $this->requestId; } /** * Set request ID. * * @param string $requestId Request ID. * @return $this */ public function setRequestId($requestId) { $this->requestId = $requestId; return $this; } /** * Get source. * * @return string */ public function getSource() { return $this->source; } /** * Set request ID. * * @param string $source Source. * @return $this */ public function setSource($source) { $this->source = $source; return $this; } /** * Get code. * * @return string */ public function getCode() { return $this->code; } /** * Set code. * * @param string $code Code. * @return $this */ public function setCode($code) { $this->code = $code; return $this; } /** * Get external ID. * * @return string */ public function getExternalId() { return $this->externalId; } /** * Set external ID. * * @param string $externalId External ID. * @return $this */ public function setExternalId($externalId) { $this->externalId = $externalId; return $this; } }