Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
logger.php
1
<?php
2
3
namespace
Bitrix\Sale\Exchange\Internals
;
4
5
6
use
Bitrix\Main\Config\Option
;
7
use
Bitrix\Main\Type\DateTime
;
8
use
Bitrix\Sale\Exchange\Logger\Exchange
;
9
use
Bitrix\Sale\Exchange\Logger\ProviderType
;
10
use
Bitrix\Sale\Internals\Fields
;
11
12
class
Logger
13
{
15
protected
$fields
;
16
17
public
function
__construct
()
18
{
19
$this->fields =
new
Fields
();
20
}
21
25
public
static
function
getCurrent
()
26
{
27
return
new
static
();
28
}
29
34
public
function
setField
($name, $value)
35
{
36
$this->fields->set($name, $value);
37
}
38
43
public
function
getField
($name)
44
{
45
return
$this->fields->get($name);
46
}
47
51
public
function
save
()
52
{
53
$params[
'ENTITY_ID'
] = $this->
getField
(
'ENTITY_ID'
);
54
$params[
'ENTITY_TYPE_ID'
] = $this->
getField
(
'ENTITY_TYPE_ID'
);
55
$params[
'PARENT_ID'
] = $this->
getField
(
'PARENT_ID'
);
56
$params[
'OWNER_ENTITY_ID'
] = $this->
getField
(
'OWNER_ENTITY_ID'
);
57
$params[
'ENTITY_DATE_UPDATE'
] = $this->
getField
(
'ENTITY_DATE_UPDATE'
);
58
$params[
'XML_ID'
] = $this->
getField
(
'XML_ID'
);
59
$params[
'DESCRIPTION'
] = $this->
getField
(
'DESCRIPTION'
);
60
$params[
'MESSAGE'
] = $this->
getField
(
'MESSAGE'
);
61
$params[
'DIRECTION'
] = $this->
getField
(
'DIRECTION'
);
62
$params[
'MARKED'
] = $this->
getField
(
'MARKED'
) ===
'Y'
?
'Y'
:
'N'
;
63
$params[
'DATE_INSERT'
] =
new
DateTime
();
64
65
return
static::log($params);
66
}
67
73
static
public
function
log
(array $params)
74
{
75
$result = (
new
Exchange
(ProviderType::ONEC_NAME))->add($params);
76
return
$result;
77
}
78
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Sale\Exchange\Internals\Logger
Definition
logger.php:13
Bitrix\Sale\Exchange\Internals\Logger\__construct
__construct()
Definition
logger.php:17
Bitrix\Sale\Exchange\Internals\Logger\getCurrent
static getCurrent()
Definition
logger.php:25
Bitrix\Sale\Exchange\Internals\Logger\$fields
$fields
Definition
logger.php:15
Bitrix\Sale\Exchange\Internals\Logger\log
static log(array $params)
Definition
logger.php:73
Bitrix\Sale\Exchange\Internals\Logger\setField
setField($name, $value)
Definition
logger.php:34
Bitrix\Sale\Exchange\Internals\Logger\getField
getField($name)
Definition
logger.php:43
Bitrix\Sale\Exchange\Internals\Logger\save
save()
Definition
logger.php:51
Bitrix\Sale\Exchange\Logger\Exchange
Definition
exchange.php:11
Bitrix\Sale\Exchange\Logger\ProviderType
Definition
providertype.php:5
Bitrix\Sale\Internals\Fields
Definition
fields.php:6
Bitrix\Sale\Exchange\Internals
Definition
exchangelog.php:3
modules
sale
lib
exchange
internals
logger.php
Создано системой
1.10.0