Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
entityimportfactory.php
1
<?php
2
namespace
Bitrix\Sale\Exchange\Entity\SubordinateSale
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Sale\Exchange
;
6
12
class
EntityImportFactory
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
{
30
throw
new
Main\ArgumentOutOfRangeException
(
'Is not defined'
,
Exchange
\
EntityType::FIRST
,
Exchange
\
EntityType::LAST
);
31
}
32
33
if
($entityTypeID ===
Exchange
\
EntityType::ORDER
)
34
{
35
return
new
Exchange\Entity\SubordinateSale\Order
(
null
);
36
}
37
elseif($entityTypeID ===
Exchange
\
EntityType::SHIPMENT
)
38
{
39
return
new
Exchange\Entity\SubordinateSale\Shipment
($parentEntityContext);
40
}
41
elseif($entityTypeID ===
Exchange
\
EntityType::PAYMENT_CASH
)
42
{
43
return
new
Exchange\Entity\PaymentCashImport
($parentEntityContext);
44
}
45
elseif($entityTypeID ===
Exchange
\
EntityType::PAYMENT_CASH_LESS
)
46
{
47
return
new
Exchange\Entity\PaymentCashLessImport
($parentEntityContext);
48
}
49
elseif($entityTypeID ===
Exchange
\
EntityType::PAYMENT_CARD_TRANSACTION
)
50
{
51
return
new
Exchange\Entity\PaymentCardImport
($parentEntityContext);
52
}
53
elseif($entityTypeID ===
Exchange
\
EntityType::USER_PROFILE
)
54
{
55
return
new
Exchange\Entity\UserProfileImport
();
56
}
57
else
58
{
59
throw
new
Main\NotSupportedException
(
"Entity type: '"
.
Exchange
\EntityType::ResolveName($entityTypeID).
"' is not supported in current context"
);
60
}
61
}
62
}
Bitrix\Main\ArgumentOutOfRangeException
Definition
exception.php:67
Bitrix\Main\NotSupportedException
Definition
exception.php:159
Bitrix\Sale\Exchange\Entity\EntityImportFactory
Definition
entityimportfactory.php:13
Bitrix\Sale\Exchange\Entity\PaymentCardImport
Definition
paymentimport.php:297
Bitrix\Sale\Exchange\Entity\PaymentCashImport
Definition
paymentimport.php:271
Bitrix\Sale\Exchange\Entity\PaymentCashLessImport
Definition
paymentimport.php:284
Bitrix\Sale\Exchange\Entity\SubordinateSale\EntityImportFactory\create
static create($entityTypeID, $parentEntityContext=null)
Definition
entityimportfactory.php:21
Bitrix\Sale\Exchange\Entity\SubordinateSale\Order
Definition
order.php:6
Bitrix\Sale\Exchange\Entity\SubordinateSale\Shipment
Definition
shipment.php:10
Bitrix\Sale\Exchange\Entity\UserProfileImport
Definition
userprofileimport.php:11
Bitrix\Sale\Exchange\EntityType\ORDER
const ORDER
Definition
entitytype.php:8
Bitrix\Sale\Exchange\EntityType\LAST
const LAST
Definition
entitytype.php:23
Bitrix\Sale\Exchange\EntityType\PAYMENT_CASH_LESS
const PAYMENT_CASH_LESS
Definition
entitytype.php:11
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\FIRST
const FIRST
Definition
entitytype.php:22
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\Logger\Exchange
Definition
exchange.php:11
Bitrix\Main
Bitrix\Sale\Exchange\Entity\SubordinateSale
Definition
entityimportfactory.php:2
Bitrix\Sale\Exchange
Definition
basetrait.php:2
modules
sale
lib
exchange
entity
subordinatesale
entityimportfactory.php
Создано системой
1.10.0