Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
managerbase.php
1
<?php
2
3
namespace
Bitrix\Sale\Exchange
;
4
5
6
use
Bitrix\Main\ArgumentOutOfRangeException
;
7
use
Bitrix\Main\NotImplementedException
;
8
use
Bitrix\Sale\Exchange\Internals\ExchangeLogTable
;
9
use
Bitrix\Sale\Exchange\Internals\LoggerDiag
;
10
use
Bitrix\Sale\Exchange\Logger\Exchange
;
11
use Bitrix\Sale\Exchange\ProviderType\ProviderType;
12
13
abstract
class
ManagerBase
14
{
15
const
EXCHANGE_DIRECTION_IMPORT
=
'I'
;
16
const
EXCHANGE_DIRECTION_EXPORT
=
'E'
;
17
18
protected
static
$instance
=
null
;
20
protected
$settings
=
null
;
22
protected
$logger
=
null
;
23
28
static
public
function
getDirectionType
()
29
{
30
throw
new
NotImplementedException
(
'The method is not implemented.'
);
31
}
32
36
private
static
function
getInstance()
37
{
38
if
(self::$instance ===
null
)
39
{
40
self::$instance =
new
static
();
41
}
42
return
self::$instance
;
43
}
44
51
static
protected
function
getImportByType
($typeId)
52
{
53
static::IsDefinedTypeId($typeId);
54
55
$import = static::getInstance();
56
return
isset($import[$typeId]) ? $import[$typeId] :
null
;
57
}
58
63
static
public
function
configure
(
ImportBase
$entity)
64
{
65
throw
new
NotImplementedException
(
'The method is not implemented.'
);
66
}
67
72
static
public
function
deleteLoggingDate
()
73
{
74
(
new
Exchange
(
Logger
\ProviderType::ONEC_NAME))
75
->deleteOldRecords(static::getDirectionType(), LoggerDiag::getInterval());
76
}
77
78
static
protected
function
IsDefinedTypeId
($typeId)
79
{
80
if
(!is_int($typeId))
81
{
82
$typeId = (int)$typeId;
83
}
84
85
if
(!EntityType::IsDefined($typeId))
86
{
87
throw
new
ArgumentOutOfRangeException
(
'Is not defined'
,
EntityType::FIRST
,
EntityType::LAST
);
88
}
89
}
90
}
Bitrix\Main\ArgumentOutOfRangeException
Definition
exception.php:67
Bitrix\Main\Diag\Logger
Definition
logger.php:19
Bitrix\Main\NotImplementedException
Definition
exception.php:147
Bitrix\Sale\Exchange\EntityType\LAST
const LAST
Definition
entitytype.php:23
Bitrix\Sale\Exchange\EntityType\FIRST
const FIRST
Definition
entitytype.php:22
Bitrix\Sale\Exchange\ImportBase
Definition
importbase.php:9
Bitrix\Sale\Exchange\Internals\ExchangeLogTable
Definition
exchangelog.php:25
Bitrix\Sale\Exchange\Internals\LoggerDiag
Definition
loggerdiag.php:7
Bitrix\Sale\Exchange\Logger\Exchange
Definition
exchange.php:11
Bitrix\Sale\Exchange\ManagerBase
Definition
managerbase.php:14
Bitrix\Sale\Exchange\ManagerBase\EXCHANGE_DIRECTION_EXPORT
const EXCHANGE_DIRECTION_EXPORT
Definition
managerbase.php:16
Bitrix\Sale\Exchange\ManagerBase\$logger
$logger
Definition
managerbase.php:22
Bitrix\Sale\Exchange\ManagerBase\IsDefinedTypeId
static IsDefinedTypeId($typeId)
Definition
managerbase.php:78
Bitrix\Sale\Exchange\ManagerBase\configure
static configure(ImportBase $entity)
Definition
managerbase.php:63
Bitrix\Sale\Exchange\ManagerBase\getDirectionType
static getDirectionType()
Definition
managerbase.php:28
Bitrix\Sale\Exchange\ManagerBase\deleteLoggingDate
static deleteLoggingDate()
Definition
managerbase.php:72
Bitrix\Sale\Exchange\ManagerBase\$instance
static $instance
Definition
managerbase.php:18
Bitrix\Sale\Exchange\ManagerBase\EXCHANGE_DIRECTION_IMPORT
const EXCHANGE_DIRECTION_IMPORT
Definition
managerbase.php:15
Bitrix\Sale\Exchange\ManagerBase\getImportByType
static getImportByType($typeId)
Definition
managerbase.php:51
Bitrix\Sale\Exchange\ManagerBase\$settings
$settings
Definition
managerbase.php:20
Bitrix\Sale\Exchange
Definition
basetrait.php:2
modules
sale
lib
exchange
managerbase.php
Создано системой
1.10.0