Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
logger.php
1<?php
2
4
5
11
12class 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}
static log(array $params)
Definition logger.php:73