Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
entityimportloaderfactory.php
1<?php
3
6
13{
21 public static function create($entityTypeID)
22 {
23 if(!is_int($entityTypeID))
24 {
25 $entityTypeID = (int)$entityTypeID;
26 }
27
28 if(!EntityType::IsDefined($entityTypeID))
29 {
30 throw new Main\ArgumentException('Is not defined', 'entityTypeID');
31 }
32
33 if($entityTypeID === EntityType::ORDER)
34 {
35 return new OrderImportLoader();
36 }
37 elseif($entityTypeID === EntityType::SHIPMENT)
38 {
39 return new ShipmentImportLoader();
40 }
41 elseif($entityTypeID === EntityType::PAYMENT_CASH ||
42 $entityTypeID === EntityType::PAYMENT_CASH_LESS ||
44 {
45 return new PaymentImportLoader();
46 }
47 elseif($entityTypeID == EntityType::USER_PROFILE ||
49 {
50 return new UserProfileImportLoader();
51 }
52 elseif ($entityTypeID === EntityType::INVOICE)
53 {
54 return new InvoiceImportLoader();
55 }
56 elseif($entityTypeID === EntityType::INVOICE_SHIPMENT)
57 {
58 return new ShipmentInvoiceImportLoader();
59 }
60 elseif($entityTypeID === EntityType::INVOICE_PAYMENT_CASH ||
61 $entityTypeID === EntityType::INVOICE_PAYMENT_CASH_LESS ||
63 {
64 return new PaymentInvoiceImportLoader();
65 }
66 else
67 {
68 throw new Main\NotSupportedException("Entity type: '".EntityType::ResolveName($entityTypeID)."' is not supported in current context");
69 }
70 }
71}