1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
converterfactory.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Sale\Exchange\OneC\SubordinateSale;
4
5
6
use Bitrix\Main\ArgumentOutOfRangeException;
7
use Bitrix\Main\NotSupportedException;
8
use Bitrix\Sale\Exchange\EntityType;
9
use Bitrix\Sale\Exchange\IConverter;
10
use Bitrix\Sale\Exchange\OneC\ConverterDocumentPayment;
11
use Bitrix\Sale\Exchange\OneC\ConverterDocumentProfile;
12
13
class
ConverterFactory
14
{
21
public
static
function
create
($typeId)
22
{
23
if
(!is_int($typeId))
24
{
25
$typeId = (int)$typeId;
26
}
27
28
if
(!EntityType::IsDefined($typeId))
29
{
30
throw
new
ArgumentOutOfRangeException
(
'documentTypeID'
,
EntityType::FIRST
,
EntityType::LAST
);
31
}
32
33
if
($typeId ===
EntityType::ORDER
)
34
{
35
return
new
ConverterDocumentOrder
();
36
}
37
elseif
($typeId ===
EntityType::SHIPMENT
)
38
{
39
return
new
ConverterDocumentShipment
();
40
}
41
elseif
($typeId ===
EntityType::PAYMENT_CASH
||
42
$typeId ===
EntityType::PAYMENT_CASH_LESS
||
43
$typeId ===
EntityType::PAYMENT_CARD_TRANSACTION
)
44
{
45
return
new
ConverterDocumentPayment
();
46
}
47
elseif
($typeId ==
EntityType::PROFILE
||
48
$typeId ==
EntityType::USER_PROFILE
)
49
{
50
return
new
ConverterDocumentProfile
();
51
}
52
else
53
{
54
throw
new
NotSupportedException
(
"Entity type: '"
.EntityType::ResolveName($typeId).
"' is not supported in current context"
);
55
}
56
}
57
}
Bitrix\Main\ArgumentOutOfRangeException
Определения
ArgumentOutOfRangeException.php:9
Bitrix\Main\NotSupportedException
Определения
NotSupportedException.php:9
Bitrix\Sale\Exchange\EntityType\ORDER
const ORDER
Определения
entitytype.php:8
Bitrix\Sale\Exchange\EntityType\LAST
const LAST
Определения
entitytype.php:23
Bitrix\Sale\Exchange\EntityType\PAYMENT_CASH_LESS
const PAYMENT_CASH_LESS
Определения
entitytype.php:11
Bitrix\Sale\Exchange\EntityType\PAYMENT_CASH
const PAYMENT_CASH
Определения
entitytype.php:10
Bitrix\Sale\Exchange\EntityType\USER_PROFILE
const USER_PROFILE
Определения
entitytype.php:14
Bitrix\Sale\Exchange\EntityType\PROFILE
const PROFILE
Определения
entitytype.php:13
Bitrix\Sale\Exchange\EntityType\FIRST
const FIRST
Определения
entitytype.php:22
Bitrix\Sale\Exchange\EntityType\SHIPMENT
const SHIPMENT
Определения
entitytype.php:9
Bitrix\Sale\Exchange\EntityType\PAYMENT_CARD_TRANSACTION
const PAYMENT_CARD_TRANSACTION
Определения
entitytype.php:12
Bitrix\Sale\Exchange\OneC\ConverterDocumentPayment
Определения
converterdocumentpayment.php:17
Bitrix\Sale\Exchange\OneC\ConverterDocumentProfile
Определения
converterdocumentprofile.php:13
Bitrix\Sale\Exchange\OneC\SubordinateSale\ConverterDocumentOrder
Определения
converterdocumentorder.php:7
Bitrix\Sale\Exchange\OneC\SubordinateSale\ConverterDocumentShipment
Определения
converterdocumentshipment.php:10
Bitrix\Sale\Exchange\OneC\SubordinateSale\ConverterFactory
Определения
converterfactory.php:14
Bitrix\Sale\Exchange\OneC\SubordinateSale\ConverterFactory\create
static create($typeId)
Определения
converterfactory.php:21
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
sale
lib
exchange
onec
subordinatesale
converterfactory.php
Создано системой
1.14.0