Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
logcomment.php
1
<?php
8
namespace
Bitrix\Socialnetwork\Item
;
9
10
use
Bitrix\Socialnetwork\LogCommentTable
;
11
12
class
LogComment
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
}
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Definition
datamanager.php:441
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Socialnetwork\Item\LogComment
Definition
logcomment.php:13
Bitrix\Socialnetwork\Item\LogComment\setFields
setFields($fields=array())
Definition
logcomment.php:59
Bitrix\Socialnetwork\Item\LogComment\getById
static getById($logCommentId=0)
Definition
logcomment.php:16
Bitrix\Socialnetwork\Item\LogComment\getFields
getFields()
Definition
logcomment.php:64
Bitrix\Socialnetwork\LogCommentTable
Definition
logcomment.php:30
Bitrix\Main\Type
Definition
collection.php:2
Bitrix\Socialnetwork\Item
Definition
contentviewhandler.php:9
Bitrix
modules
socialnetwork
lib
item
logcomment.php
Создано системой
1.10.0