Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
log.php
1
<?php
8
namespace
Bitrix\Socialnetwork\Item
;
9
10
use
Bitrix\Main\Config\Option
;
11
use
Bitrix\Main\Error
;
12
use
Bitrix\Main\Loader
;
13
use
Bitrix\Main\Localization\Loc
;
14
use
Bitrix\Main\ModuleManager
;
15
use
Bitrix\Socialnetwork\ComponentHelper
;
16
use
Bitrix\Socialnetwork\LogTable
;
17
use
Bitrix\Socialnetwork\Controller\Livefeed
;
18
19
class
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
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\ModuleManager
Definition
modulemanager.php:5
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\ComponentHelper
Definition
componenthelper.php:32
Bitrix\Socialnetwork\Item\Log
Definition
log.php:20
Bitrix\Socialnetwork\Item\Log\setFields
setFields($fields=array())
Definition
log.php:70
Bitrix\Socialnetwork\Item\Log\getById
static getById($logId=0)
Definition
log.php:23
Bitrix\Socialnetwork\Item\Log\setLimitedView
static setLimitedView($params=array())
Definition
log.php:80
Bitrix\Socialnetwork\Item\Log\getFields
getFields()
Definition
log.php:75
Bitrix\Socialnetwork\LogTable
Definition
log.php:36
Bitrix\Main\Type
Definition
collection.php:2
Bitrix\Socialnetwork\Controller\Livefeed
Definition
blogpost.php:3
Bitrix\Socialnetwork\Item
Definition
contentviewhandler.php:9
Bitrix
modules
socialnetwork
lib
item
log.php
Создано системой
1.10.0