Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
logcomment.php
1<?php
9
11
13{
14 private $fields;
15
16 public static function getById($logCommentId = 0)
17 {
18 static $cachedFields = array();
19
20 $logCommentItem = false;
21 $logCommentId = intval($logCommentId);
22
23 if ($logCommentId > 0)
24 {
25 $logCommentItem = new LogComment;
26 $logCommentFields = array();
27
28 if (isset($cachedFields[$logCommentId]))
29 {
30 $logCommentFields = $cachedFields[$logCommentId];
31 }
32 else
33 {
34 $select = array('*');
35
36 $res = LogCommentTable::getList(array(
37 'filter' => array('=ID' => $logCommentId),
38 'select' => $select
39 ));
40 if ($fields = $res->fetch())
41 {
42 $logCommentFields = $fields;
43
44 if ($logCommentFields['LOG_DATE'] instanceof \Bitrix\Main\Type\DateTime)
45 {
46 $logCommentFields['LOG_DATE'] = $logCommentFields['LOG_DATE']->toString();
47 }
48 }
49
50 $cachedFields[$logCommentId] = $logCommentFields;
51 }
52
53 $logCommentItem->setFields($logCommentFields);
54 }
55
56 return $logCommentItem;
57 }
58
59 public function setFields($fields = array())
60 {
61 $this->fields = $fields;
62 }
63
64 public function getFields()
65 {
66 return $this->fields;
67 }
68}
static getList(array $parameters=array())
static getById($logCommentId=0)