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/template/node/ |
Upload File : |
<?php namespace Yandex\Market\Template\Node; use Bitrix\Iblock\Template\Entity; use Yandex\Market; use Bitrix\Main; use Bitrix\Iblock; if (!Main\Loader::includeModule('iblock')) { throw new Main\SystemException('require module iblock'); } else if (!class_exists('\Bitrix\Iblock\Template\NodeEntityField')) // force load sibling class, cause original class not registered in iblock loader { throw new Main\SystemException('cant load iblock template engine'); } class Field extends Iblock\Template\NodeBase { protected $sourceType; protected $sourceField; public function __construct($sourceType = '', $sourceField = '') { $this->sourceType = $sourceType; $this->sourceField = $sourceField; } public function process(Entity\Base $entity) { if ($entity instanceof Market\Template\Entity\SourceValue) { $result = $entity->getField($this->sourceType, $this->sourceField); } else { $result = $entity->getField($this->sourceType . '.' . $this->sourceField); } return $result; } /** * @return string */ public function getSourceType() { return $this->sourceType; } /** * @return string */ public function getSourceField() { return $this->sourceField; } }