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/catalog/lib/v2/Price/ |
Upload File : |
<?php namespace Bitrix\Catalog\v2\Price; use Bitrix\Catalog\v2\IoC\ContainerContract; /** * Class PriceFactory * * @package Bitrix\Catalog\v2\Price * * !!! This API is in alpha stage and is not stable. This is subject to change at any time without notice. * @internal */ class PriceFactory { public const SIMPLE_PRICE = SimplePrice::class; public const QUANTITY_DEPENDENT_PRICE = QuantityDependentPrice::class; public const PRICE_COLLECTION = PriceCollection::class; protected $container; /** * PriceFactory constructor. * * @param \Bitrix\Catalog\v2\IoC\ContainerContract $container */ public function __construct(ContainerContract $container) { $this->container = $container; } /** * @return \Bitrix\Catalog\v2\Price\BasePrice */ public function createEntity(): BasePrice { // $price = $this->container->make(self::QUANTITY_DEPENDENT_PRICE); return $this->container->make(self::SIMPLE_PRICE); } /** * @return \Bitrix\Catalog\v2\Price\PriceCollection */ public function createCollection(): PriceCollection { return $this->container->make(self::PRICE_COLLECTION); } }