1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
documentfactory.php
См. документацию.
1
<?php
2
namespace
Bitrix\Sale\Exchange\OneC\SubordinateSale;
3
4
5
use Bitrix\Main\ArgumentOutOfRangeException;
6
use Bitrix\Main\NotSupportedException;
7
use Bitrix\Sale\Exchange\EntityType;
8
use Bitrix\Sale\Exchange\OneC\DocumentBase;
9
use Bitrix\Sale\Exchange\OneC\DocumentType;
10
use Bitrix\Sale\Exchange\OneC\PaymentCardDocument;
11
use Bitrix\Sale\Exchange\OneC\PaymentCashDocument;
12
use Bitrix\Sale\Exchange\OneC\PaymentCashLessDocument;
13
use Bitrix\Sale\Exchange\OneC\ProfileDocument;
14
use Bitrix\Sale\Exchange\OneC\UserProfileDocument;
15
16
class
DocumentFactory
17
{
25
public
static
function
create
($documentTypeID)
26
{
27
if
(!is_int($documentTypeID))
28
{
29
$documentTypeID = (int)$documentTypeID;
30
}
31
32
if
(!DocumentType::IsDefined($documentTypeID))
33
{
34
throw
new
ArgumentOutOfRangeException
(
'documentTypeID'
,
DocumentType::FIRST
,
DocumentType::LAST
);
35
}
36
37
if
($documentTypeID ===
DocumentType::ORDER
)
38
{
39
return
new
OrderDocument
();
40
}
41
elseif
($documentTypeID ===
DocumentType::SHIPMENT
)
42
{
43
return
new
ShipmentDocument
();
44
}
45
elseif
($documentTypeID ===
DocumentType::PAYMENT_CASH
)
46
{
47
return
new
PaymentCashDocument
();
48
}
49
elseif
($documentTypeID ===
DocumentType::PAYMENT_CASH_LESS
)
50
{
51
return
new
PaymentCashLessDocument
();
52
}
53
elseif
($documentTypeID ===
DocumentType::PAYMENT_CARD_TRANSACTION
)
54
{
55
return
new
PaymentCardDocument
();
56
}
57
elseif
($documentTypeID ===
DocumentType::PROFILE
)
58
{
59
return
new
ProfileDocument
();
60
}
61
elseif
($documentTypeID ===
DocumentType::USER_PROFILE
)
62
{
63
return
new
UserProfileDocument
();
64
}
65
else
66
{
67
throw
new
NotSupportedException
(
"Document type: '"
.EntityType::ResolveName($documentTypeID).
"' is not supported in current context"
);
68
}
69
}
70
}
Bitrix\Main\ArgumentOutOfRangeException
Определения
ArgumentOutOfRangeException.php:9
Bitrix\Main\NotSupportedException
Определения
NotSupportedException.php:9
Bitrix\Sale\Exchange\OneC\DocumentType\ORDER
const ORDER
Определения
documenttype.php:12
Bitrix\Sale\Exchange\OneC\DocumentType\LAST
const LAST
Определения
documenttype.php:21
Bitrix\Sale\Exchange\OneC\DocumentType\PAYMENT_CASH_LESS
const PAYMENT_CASH_LESS
Определения
documenttype.php:15
Bitrix\Sale\Exchange\OneC\DocumentType\PAYMENT_CASH
const PAYMENT_CASH
Определения
documenttype.php:14
Bitrix\Sale\Exchange\OneC\DocumentType\USER_PROFILE
const USER_PROFILE
Определения
documenttype.php:18
Bitrix\Sale\Exchange\OneC\DocumentType\PROFILE
const PROFILE
Определения
documenttype.php:17
Bitrix\Sale\Exchange\OneC\DocumentType\FIRST
const FIRST
Определения
documenttype.php:20
Bitrix\Sale\Exchange\OneC\DocumentType\SHIPMENT
const SHIPMENT
Определения
documenttype.php:13
Bitrix\Sale\Exchange\OneC\DocumentType\PAYMENT_CARD_TRANSACTION
const PAYMENT_CARD_TRANSACTION
Определения
documenttype.php:16
Bitrix\Sale\Exchange\OneC\PaymentCardDocument
Определения
paymentdocument.php:356
Bitrix\Sale\Exchange\OneC\PaymentCashDocument
Определения
paymentdocument.php:334
Bitrix\Sale\Exchange\OneC\PaymentCashLessDocument
Определения
paymentdocument.php:345
Bitrix\Sale\Exchange\OneC\ProfileDocument
Определения
profiledocument.php:13
Bitrix\Sale\Exchange\OneC\SubordinateSale\DocumentFactory
Определения
documentfactory.php:17
Bitrix\Sale\Exchange\OneC\SubordinateSale\DocumentFactory\create
static create($documentTypeID)
Определения
documentfactory.php:25
Bitrix\Sale\Exchange\OneC\SubordinateSale\OrderDocument
Определения
orderdocument.php:7
Bitrix\Sale\Exchange\OneC\SubordinateSale\ShipmentDocument
Определения
shipmentdocument.php:7
Bitrix\Sale\Exchange\OneC\UserProfileDocument
Определения
userprofiledocument.php:7
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
sale
lib
exchange
onec
subordinatesale
documentfactory.php
Создано системой
1.14.0