Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ProductFactory.php
1<?php
2
4
8
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}
createEntity(string $entityClass=self::PRODUCT)