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/cvetdv.ru/bitrix/modules/yandex.market/lib/ui/iblock/categoryform/ |
Upload File : |
<?php namespace Yandex\Market\Ui\Iblock\CategoryForm; use Yandex\Market\Reference\Concerns; use Yandex\Market\Ui\Iblock\CategoryProvider; use Yandex\Market\Ui\Iblock\CategoryValue; use Yandex\Market\Ui\Iblock\CategoryValue\SectionValue; class Section implements Form { use Concerns\HasMessage; private $userField; private $sectionId; public function __construct(array $field, $sectionId) { $this->userField = $field; $this->sectionId = $sectionId; } public function type() { return Factory::SECTION; } public function payload() { return [ 'sectionId' => $this->sectionId, ]; } public function fields() { return [ 'parentId' => 'IBLOCK_SECTION_ID', ]; } public function theme() { return CategoryProvider::THEME_FORM; } public function parentValue(array $fields = null) { $iblockId = CategoryValue\FieldRepository::iblockId($this->userField['ENTITY_ID']); if (isset($fields['parentId'])) { return new SectionValue($iblockId, (int)$fields['parentId'], $this->userField['FIELD_NAME']); } return (new SectionValue($iblockId, $this->sectionId, $this->userField['FIELD_NAME']))->parent(); } }