AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 52.15.181.10
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/bitrix/www/bitrix/modules/catalog/lib/v2/StoreProduct/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/bitrix/www/bitrix/modules/catalog/lib/v2/StoreProduct/StoreProduct.php
<?php

namespace Bitrix\Catalog\v2\StoreProduct;

use Bitrix\Catalog\v2\BaseEntity;
use Bitrix\Catalog\v2\Fields\TypeCasters\MapTypeCaster;
use Bitrix\Catalog\v2\HasSettingsTrait;

/**
 * Class StoreProduct
 *
 * @package Bitrix\Catalog\v2\StoreProduct
 *
 * !!! This API is in alpha stage and is not stable. This is subject to change at any time without notice.
 * @internal
 */

class StoreProduct extends BaseEntity
{
	use HasSettingsTrait;

	public function __construct(StoreProductRepositoryContract $repository)
	{
		parent::__construct($repository);
	}

	public function setStoreId(int $storeId): self
	{
		$this->setField('STORE_ID', $storeId);

		return $this;
	}

	public function getStoreId(): string
	{
		return $this->getField('STORE_ID');
	}

	public function setProductId(int $productId): self
	{
		$this->setField('PRODUCT_ID', $productId);

		return $this;
	}

	public function getProductId(): int
	{
		return (int)$this->getField('PRODUCT_ID');
	}

	public function setAmount(?float $amount): self
	{
		$this->setField('AMOUNT', $amount);

		return $this;
	}

	public function unsetAmount(): self
	{
		return $this->setAmount(null);
	}

	public function hasAmount(): bool
	{
		return $this->hasField('AMOUNT');
	}

	public function getAmount(): ?float
	{
		return $this->hasAmount() ? (float)$this->getField('AMOUNT') : null;
	}

	protected function getFieldsMap(): array
	{
		return [
			'ID' => MapTypeCaster::NULLABLE_INT,
			'STORE_ID' => MapTypeCaster::INT,
			'PRODUCT_ID' => MapTypeCaster::INT,
			'AMOUNT' => MapTypeCaster::NULLABLE_FLOAT,
			'QUANTITY_RESERVED' =>  MapTypeCaster::NULLABLE_FLOAT,
		];
	}
}

Anon7 - 2022
AnonSec Team