Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
log.php
1<?php
9
18
19class Log
20{
21 private $fields;
22
23 public static function getById($logId = 0)
24 {
25 static $cachedFields = array();
26
27 $logItem = false;
28 $logId = intval($logId);
29
30 if ($logId > 0)
31 {
32 $logItem = new Log;
33 $logFields = array();
34
35 if (isset($cachedFields[$logId]))
36 {
37 $logFields = $cachedFields[$logId];
38 }
39 else
40 {
41 $select = array('*');
42
43 $res = LogTable::getList(array(
44 'filter' => array('=ID' => $logId),
45 'select' => $select
46 ));
47 if ($fields = $res->fetch())
48 {
49 $logFields = $fields;
50
51 if ($logFields['LOG_DATE'] instanceof \Bitrix\Main\Type\DateTime)
52 {
53 $logFields['LOG_DATE'] = $logFields['LOG_DATE']->toString();
54 }
55 if ($logFields['LOG_UPDATE'] instanceof \Bitrix\Main\Type\DateTime)
56 {
57 $logFields['LOG_UPDATE'] = $logFields['LOG_UPDATE']->toString();
58 }
59 }
60
61 $cachedFields[$logId] = $logFields;
62 }
63
64 $logItem->setFields($logFields);
65 }
66
67 return $logItem;
68 }
69
70 public function setFields($fields = array())
71 {
72 $this->fields = $fields;
73 }
74
75 public function getFields()
76 {
77 return $this->fields;
78 }
79
80 public static function setLimitedView($params = array())
81 {
82 return false;
83 }
84}
static getList(array $parameters=array())
setFields($fields=array())
Definition log.php:70
static getById($logId=0)
Definition log.php:23
static setLimitedView($params=array())
Definition log.php:80