Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
factory.php
1<?php
2
3
5
6
9
11{
12 public static function create($typeName, $params=[])
13 {
14 if($typeName === Registry::ENTITY_SHIPMENT
15 || $typeName === Registry::ENTITY_ORDER
16 || $typeName === Registry::ENTITY_PAYMENT
17 || $typeName === Registry::ENTITY_PROPERTY_VALUE
19 || $typeName === Registry::ENTITY_TAX
20 || $typeName === Registry::ENTITY_BASKET_ITEM
22 || $typeName === Registry::ENTITY_SHIPMENT_ITEM
26 || $typeName === Registry::ENTITY_OPTIONS
27 || $typeName === Registry::ENTITY_DISCOUNT
29 || $typeName === Registry::ENTITY_ORDER_DISCOUNT
30 || $typeName === Registry::ENTITY_PERSON_TYPE
31 || $typeName === Registry::ENTITY_ORDER_STATUS
33 || $typeName === Registry::ENTITY_ENTITY_MARKER
34 || $typeName === Registry::ENTITY_ORDER_HISTORY
35 || $typeName === Registry::ENTITY_NOTIFY
37 || $typeName === ENTITY_CRM_CONTACT_COMPANY_COLLECTION)
38 {
39 return new Entity($typeName);
40 }
42 {
43 return new TradeBinding($typeName, $params);
44 }
46 {
47 return new ShipmentItem($typeName, $params);
48 }
49 elseif ($typeName === Registry::ENTITY_SHIPMENT_COLLECTION)
50 {
51 return new Shipment($typeName, $params);
52 }
53 elseif ($typeName === Registry::ENTITY_PAYMENT_COLLECTION)
54 {
55 return new Payment($typeName, $params);
56 }
58 {
59 return new BasketProperties($typeName, $params);
60 }
61 elseif($typeName === Registry::ENTITY_BASKET)
62 {
63 return new BasketItem($typeName, $params);
64 }
65 elseif($typeName === Registry::ENTITY_PROPERTY)
66 {
67 return new Property($typeName);
68 }
69 elseif ($typeName === 'TRADING_PLATFORM_TYPE')
70 {
71 return new TradingPlatform($typeName);
72 }
73 elseif ($typeName === 'PRODUCT')
74 {
75 return new Product($typeName, $params);
76 }
77 elseif ($typeName === 'PAY_SYSTEM_TYPE')
78 {
79 return new PaySystem($typeName, $params);
80 }
81 elseif ($typeName === 'DELIVERY_SYSTEM_TYPE')
82 {
83 return new DeliverySystem($typeName, $params);
84 }
85 elseif ($typeName === 'PERSON_TYPE_TYPE')
86 {
87 return new PersonType($typeName, $params);
88 }
89 else
90 {
91 throw new NotSupportedException("Entity type: '".$typeName."' is not supported in current context");
92 }
93 }
94}
const ENTITY_BASKET_PROPERTIES_COLLECTION
Definition registry.php:33
const ENTITY_BASKET_PROPERTY_ITEM
Definition registry.php:34
const ENTITY_SHIPMENT_COLLECTION
Definition registry.php:26
const ENTITY_TRADE_BINDING_COLLECTION
Definition registry.php:55
const ENTITY_PROPERTY_VALUE
Definition registry.php:27
const ENTITY_BUNDLE_COLLECTION
Definition registry.php:29
const ENTITY_PAYMENT_COLLECTION
Definition registry.php:22
const ENTITY_PROPERTY_VALUE_COLLECTION
Definition registry.php:41
const ENTITY_ORDER_DISCOUNT
Definition registry.php:46
const ENTITY_DISCOUNT_COUPON
Definition registry.php:45
const ENTITY_SHIPMENT_ITEM_COLLECTION
Definition registry.php:38
const ENTITY_TRADE_BINDING_ENTITY
Definition registry.php:56
const ENTITY_SHIPMENT_ITEM_STORE_COLLECTION
Definition registry.php:40
const ENTITY_DELIVERY_STATUS
Definition registry.php:49
const ENTITY_SHIPMENT_ITEM_STORE
Definition registry.php:39
static create($typeName, $params=[])
Definition factory.php:12