Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
entityimportloaderfactory.php
1
<?php
2
namespace
Bitrix\Sale\Exchange\Entity
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Sale\Exchange\EntityType
;
6
12
class
EntityImportLoaderFactory
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
||
43
$entityTypeID ===
EntityType::PAYMENT_CARD_TRANSACTION
)
44
{
45
return
new
PaymentImportLoader
();
46
}
47
elseif($entityTypeID ==
EntityType::USER_PROFILE
||
48
$entityTypeID ==
EntityType::USER_PROFILE_CONTACT_COMPANY
)
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
||
62
$entityTypeID ===
EntityType::INVOICE_PAYMENT_CARD_TRANSACTION
)
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
}
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\NotSupportedException
Definition
exception.php:159
Bitrix\Sale\Exchange\Entity\EntityImportLoaderFactory
Definition
entityimportloaderfactory.php:13
Bitrix\Sale\Exchange\Entity\EntityImportLoaderFactory\create
static create($entityTypeID)
Definition
entityimportloaderfactory.php:21
Bitrix\Sale\Exchange\Entity\InvoiceImportLoader
Definition
entityimportloader.php:311
Bitrix\Sale\Exchange\Entity\OrderImportLoader
Definition
entityimportloader.php:166
Bitrix\Sale\Exchange\Entity\PaymentImportLoader
Definition
entityimportloader.php:182
Bitrix\Sale\Exchange\Entity\PaymentInvoiceImportLoader
Definition
entityimportloader.php:319
Bitrix\Sale\Exchange\Entity\ShipmentImportLoader
Definition
entityimportloader.php:199
Bitrix\Sale\Exchange\Entity\ShipmentInvoiceImportLoader
Definition
entityimportloader.php:327
Bitrix\Sale\Exchange\Entity\UserProfileImportLoader
Definition
entityimportloader.php:244
Bitrix\Sale\Exchange\EntityType
Definition
entitytype.php:6
Bitrix\Sale\Exchange\EntityType\ORDER
const ORDER
Definition
entitytype.php:8
Bitrix\Sale\Exchange\EntityType\INVOICE_PAYMENT_CASH
const INVOICE_PAYMENT_CASH
Definition
entitytype.php:18
Bitrix\Sale\Exchange\EntityType\USER_PROFILE_CONTACT_COMPANY
const USER_PROFILE_CONTACT_COMPANY
Definition
entitytype.php:15
Bitrix\Sale\Exchange\EntityType\INVOICE_PAYMENT_CASH_LESS
const INVOICE_PAYMENT_CASH_LESS
Definition
entitytype.php:19
Bitrix\Sale\Exchange\EntityType\PAYMENT_CASH_LESS
const PAYMENT_CASH_LESS
Definition
entitytype.php:11
Bitrix\Sale\Exchange\EntityType\INVOICE
const INVOICE
Definition
entitytype.php:16
Bitrix\Sale\Exchange\EntityType\PAYMENT_CASH
const PAYMENT_CASH
Definition
entitytype.php:10
Bitrix\Sale\Exchange\EntityType\USER_PROFILE
const USER_PROFILE
Definition
entitytype.php:14
Bitrix\Sale\Exchange\EntityType\INVOICE_PAYMENT_CARD_TRANSACTION
const INVOICE_PAYMENT_CARD_TRANSACTION
Definition
entitytype.php:20
Bitrix\Sale\Exchange\EntityType\SHIPMENT
const SHIPMENT
Definition
entitytype.php:9
Bitrix\Sale\Exchange\EntityType\PAYMENT_CARD_TRANSACTION
const PAYMENT_CARD_TRANSACTION
Definition
entitytype.php:12
Bitrix\Sale\Exchange\EntityType\INVOICE_SHIPMENT
const INVOICE_SHIPMENT
Definition
entitytype.php:17
Bitrix\Main
Bitrix\Sale\Exchange\Entity
Definition
entityimport.php:2
modules
sale
lib
exchange
entity
entityimportloaderfactory.php
Создано системой
1.10.0