Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ProductFactory.php
1
<?php
2
3
namespace
Bitrix\Catalog\v2\Product
;
4
5
use
Bitrix\Catalog\v2\BaseIblockElementEntity
;
6
use
Bitrix\Catalog\v2\BaseIblockElementFactory
;
7
use
Bitrix\Main\NotSupportedException
;
8
17
class
ProductFactory
extends
BaseIblockElementFactory
18
{
19
public
const
PRODUCT
=
Product::class
;
20
26
public
function
createEntity
(
string
$entityClass = self::PRODUCT):
BaseIblockElementEntity
27
{
28
if
(!is_subclass_of($entityClass, BaseProduct::class))
29
{
30
throw
new
NotSupportedException
(sprintf(
31
'Entity with type {%s} must be an instance of {%s}.'
,
32
$entityClass, BaseProduct::class
33
));
34
}
35
36
return
$this->
makeEntity
($entityClass);
37
}
38
}
Bitrix\Catalog\v2\BaseIblockElementEntity
Definition
BaseIblockElementEntity.php:27
Bitrix\Catalog\v2\BaseIblockElementFactory
Definition
BaseIblockElementFactory.php:18
Bitrix\Catalog\v2\BaseIblockElementFactory\makeEntity
makeEntity(string $entityClass)
Definition
BaseIblockElementFactory.php:42
Bitrix\Catalog\v2\Product\ProductFactory
Definition
ProductFactory.php:18
Bitrix\Catalog\v2\Product\ProductFactory\PRODUCT
const PRODUCT
Definition
ProductFactory.php:19
Bitrix\Catalog\v2\Product\ProductFactory\createEntity
createEntity(string $entityClass=self::PRODUCT)
Definition
ProductFactory.php:26
Bitrix\Main\DB\Connection\$host
$host
Definition
connection.php:29
Bitrix\Main\NotSupportedException
Definition
exception.php:159
Bitrix\Catalog\v2\Product
Definition
BaseProduct.php:3
modules
catalog
lib
v2
Product
ProductFactory.php
Создано системой
1.10.0