Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
documentimportfactory.php
1
<?php
2
namespace
Bitrix\Sale\Exchange\OneC
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Sale\Exchange
;
6
7
8
class
DocumentImportFactory
9
{
17
public
static
function
create
($documentTypeID)
18
{
19
if
(!is_int($documentTypeID))
20
{
21
$documentTypeID = (int)$documentTypeID;
22
}
23
24
if
(!DocumentType::IsDefined($documentTypeID))
25
{
26
throw
new
Main\ArgumentOutOfRangeException
(
'documentTypeID'
,
DocumentType::FIRST
,
DocumentType::LAST
);
27
}
28
29
if
($documentTypeID ===
DocumentType::ORDER
)
30
{
31
return
new
OrderDocument
();
32
}
33
elseif($documentTypeID ===
DocumentType::SHIPMENT
)
34
{
35
return
new
ShipmentDocument
();
36
}
37
elseif($documentTypeID ===
DocumentType::PAYMENT_CASH
)
38
{
39
return
new
PaymentCashDocument
();
40
}
41
elseif($documentTypeID ===
DocumentType::PAYMENT_CASH_LESS
)
42
{
43
return
new
PaymentCashLessDocument
();
44
}
45
elseif($documentTypeID ===
DocumentType::PAYMENT_CARD_TRANSACTION
)
46
{
47
return
new
PaymentCardDocument
();
48
}
49
elseif($documentTypeID ===
DocumentType::PROFILE
)
50
{
51
return
new
ProfileDocument
();
52
}
53
elseif($documentTypeID ===
DocumentType::USER_PROFILE
)
54
{
55
return
new
UserProfileDocument
();
56
}
57
else
58
{
59
throw
new
Main\NotSupportedException
(
"Document type: '"
.
Exchange
\EntityType::ResolveName($documentTypeID).
"' 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\Logger\Exchange
Definition
exchange.php:11
Bitrix\Sale\Exchange\OneC\DocumentImportFactory
Definition
documentimportfactory.php:9
Bitrix\Sale\Exchange\OneC\DocumentImportFactory\create
static create($documentTypeID)
Definition
documentimportfactory.php:17
Bitrix\Sale\Exchange\OneC\DocumentType\ORDER
const ORDER
Definition
documenttype.php:12
Bitrix\Sale\Exchange\OneC\DocumentType\LAST
const LAST
Definition
documenttype.php:21
Bitrix\Sale\Exchange\OneC\DocumentType\PAYMENT_CASH_LESS
const PAYMENT_CASH_LESS
Definition
documenttype.php:15
Bitrix\Sale\Exchange\OneC\DocumentType\PAYMENT_CASH
const PAYMENT_CASH
Definition
documenttype.php:14
Bitrix\Sale\Exchange\OneC\DocumentType\USER_PROFILE
const USER_PROFILE
Definition
documenttype.php:18
Bitrix\Sale\Exchange\OneC\DocumentType\PROFILE
const PROFILE
Definition
documenttype.php:17
Bitrix\Sale\Exchange\OneC\DocumentType\FIRST
const FIRST
Definition
documenttype.php:20
Bitrix\Sale\Exchange\OneC\DocumentType\SHIPMENT
const SHIPMENT
Definition
documenttype.php:13
Bitrix\Sale\Exchange\OneC\DocumentType\PAYMENT_CARD_TRANSACTION
const PAYMENT_CARD_TRANSACTION
Definition
documenttype.php:16
Bitrix\Sale\Exchange\OneC\OrderDocument
Definition
orderdocument.php:5
Bitrix\Sale\Exchange\OneC\PaymentCardDocument
Definition
paymentdocument.php:356
Bitrix\Sale\Exchange\OneC\PaymentCashDocument
Definition
paymentdocument.php:334
Bitrix\Sale\Exchange\OneC\PaymentCashLessDocument
Definition
paymentdocument.php:345
Bitrix\Sale\Exchange\OneC\ProfileDocument
Definition
profiledocument.php:13
Bitrix\Sale\Exchange\OneC\ShipmentDocument
Definition
shipmentdocument.php:5
Bitrix\Sale\Exchange\OneC\UserProfileDocument
Definition
userprofiledocument.php:7
Bitrix\Main
Bitrix\Sale\Exchange\OneC
Definition
documents.php:2
Bitrix\Sale\Exchange
Definition
basetrait.php:2
modules
sale
lib
exchange
onec
documentimportfactory.php
Создано системой
1.10.0