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/salesboost/product/ |
Upload File : |
<?php namespace Yandex\Market\SalesBoost\Product; use Yandex\Market\SalesBoost; use Yandex\Market\Export; use Yandex\Market\Reference; /** * @method SalesBoost\Setup\Model getParent() */ class Model extends Reference\Storage\Model { public static function getDataClass() { return Table::class; } public function getFilterCollection() { return $this->getCollection('FILTER', Export\Filter\Collection::class); } public function getIblockId() { return (int)$this->getField('IBLOCK_ID'); } public function getContext() { return Export\Entity\Iblock\Provider::getContext($this->getIblockId()); } public function getTrackSourceList() { $sourceList = $this->getUsedSources(); $context = $this->getContext(); $result = []; foreach ($sourceList as $sourceType) { $eventHandler = Export\Entity\Manager::getEvent($sourceType); $result[] = [ 'SOURCE_TYPE' => $sourceType, 'SOURCE_PARAMS' => $eventHandler->getSourceParams($context) ]; } return $result; } protected function getUsedSources() { $used = $this->getUsedSelectSources() + $this->getUsedFilterSources(); return array_keys($used); } protected function getUsedSelectSources() { $fields = $this->getParent()->getBidFields(); return array_column($fields, 'SOURCE', 'SOURCE'); } protected function getUsedFilterSources() { $result = []; foreach ($this->getFilterCollection() as $filterModel) { $filterUserSources = $filterModel->getUsedSources(); $result += array_flip($filterUserSources); } return $result; } }