Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
entityimportfactory.php
1<?php
3
6
13{
21 public static function create($entityTypeID, $parentEntityContext = null)
22 {
23 if(!is_int($entityTypeID))
24 {
25 $entityTypeID = (int)$entityTypeID;
26 }
27
28 if(!Exchange\EntityType::IsDefined($entityTypeID))
29 {
31 }
32
33 if($entityTypeID === Exchange\EntityType::ORDER)
34 {
35 return new OrderImport(null);
36 }
37 elseif($entityTypeID === Exchange\EntityType::SHIPMENT)
38 {
39 return new ShipmentImport($parentEntityContext);
40 }
41 elseif($entityTypeID === Exchange\EntityType::PAYMENT_CASH)
42 {
43 return new PaymentCashImport($parentEntityContext);
44 }
45 elseif($entityTypeID === Exchange\EntityType::PAYMENT_CASH_LESS)
46 {
47 return new PaymentCashLessImport($parentEntityContext);
48 }
49 elseif($entityTypeID === Exchange\EntityType::PAYMENT_CARD_TRANSACTION)
50 {
51 return new PaymentCardImport($parentEntityContext);
52 }
53 elseif($entityTypeID === Exchange\EntityType::USER_PROFILE)
54 {
55 return new UserProfileImport();
56 }
58 {
59 return new UserProfileContactCompany();
60 }
61 elseif($entityTypeID === Exchange\EntityType::INVOICE)
62 {
63 return new Invoice(null);
64 }
65 elseif($entityTypeID === Exchange\EntityType::INVOICE_SHIPMENT)
66 {
67 return new ShipmentInvoice($parentEntityContext);
68 }
69 elseif($entityTypeID === Exchange\EntityType::INVOICE_PAYMENT_CASH)
70 {
71 return new PaymentCashInvoice($parentEntityContext);
72 }
73 elseif($entityTypeID === Exchange\EntityType::INVOICE_PAYMENT_CASH_LESS)
74 {
75 return new PaymentCashLessInvoice($parentEntityContext);
76 }
78 {
79 return new PaymentCardInvoice($parentEntityContext);
80 }
81 else
82 {
83 throw new Main\NotSupportedException("Entity type: '".Exchange\EntityType::ResolveName($entityTypeID)."' is not supported in current context");
84 }
85 }
86}
static create($entityTypeID, $parentEntityContext=null)