1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
logpinned.php
См. документацию.
1
<?php
8
namespace
Bitrix\Socialnetwork;
9
10
use Bitrix\Main;
11
use Bitrix\Main\Entity;
12
use Bitrix\Main\Localization\Loc;
13
use Bitrix\Main\NotImplementedException;
14
15
Loc::loadMessages(__FILE__);
16
33
class
LogPinnedTable
extends
Entity\DataManager
34
{
35
public
static
function
getTableName
()
36
{
37
return
'b_sonet_log_pinned'
;
38
}
39
40
public
static
function
getMap
()
41
{
42
$fieldsMap = [
43
'LOG_ID'
=> [
44
'data_type'
=>
'integer'
,
45
'primary'
=> true
46
],
47
'USER_ID'
=> [
48
'data_type'
=>
'integer'
,
49
'primary'
=> true
50
],
51
'PINNED_DATE'
=> [
52
'data_type'
=>
'datetime'
,
53
],
54
];
55
56
return
$fieldsMap;
57
}
58
59
60
public
static
function
set
(
array
$params
= [])
61
{
62
global
$USER
;
63
64
$logId = (isset(
$params
[
'logId'
]) ? intval(
$params
[
'logId'
]) : 0);
65
$userId
= (isset(
$params
[
'userId'
]) ? intval(
$params
[
'userId'
]) : (is_object(
$USER
) &&
$USER
instanceof \CUser ?
$USER
->getId() : 0));
66
67
if
($logId <= 0)
68
{
69
throw
new
Main\SystemException
(
"Empty logId."
);
70
}
71
72
if
(
$userId
<= 0)
73
{
74
throw
new
Main\SystemException
(
"Empty userId."
);
75
}
76
77
$connection
=
\Bitrix\Main\Application::getConnection
();
78
$helper =
$connection
->getSqlHelper();
79
80
$insertFields = [
81
'LOG_ID'
=> $logId,
82
'USER_ID'
=>
$userId
,
83
'PINNED_DATE'
=> new \Bitrix\Main\DB\SqlExpression($helper->getCurrentDateTimeFunction()),
84
];
85
86
$updateFields = [
87
'PINNED_DATE'
=> new \Bitrix\Main\DB\SqlExpression($helper->getCurrentDateTimeFunction()),
88
];
89
90
$merge = $helper->prepareMerge(
91
static::getTableName(),
92
[
'LOG_ID'
,
'USER_ID'
],
93
$insertFields,
94
$updateFields
95
);
96
97
if
($merge[0] !=
""
)
98
{
99
$connection
->query($merge[0]);
100
}
101
}
102
103
public
static
function
add
(
array
$data
)
104
{
105
throw
new
NotImplementedException
(
"Use set() method of the class."
);
106
}
107
108
public
static
function
update
($primary,
array
$data
)
109
{
110
throw
new
NotImplementedException
(
"Use set() method of the class."
);
111
}
112
}
$connection
$connection
Определения
actionsdefinitions.php:38
$userId
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения
check_mail.php:18
Bitrix\Main\Application\getConnection
static getConnection($name="")
Определения
application.php:638
Bitrix\Main\NotImplementedException
Определения
NotImplementedException.php:9
Bitrix\Main\SystemException
Определения
SystemException.php:9
Bitrix\Socialnetwork\LogPinnedTable
Определения
logpinned.php:34
Bitrix\Socialnetwork\LogPinnedTable\getMap
static getMap()
Определения
logpinned.php:40
Bitrix\Socialnetwork\LogPinnedTable\add
static add(array $data)
Определения
logpinned.php:103
Bitrix\Socialnetwork\LogPinnedTable\update
static update($primary, array $data)
Определения
logpinned.php:108
Bitrix\Socialnetwork\LogPinnedTable\getTableName
static getTableName()
Определения
logpinned.php:35
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$USER
global $USER
Определения
csv_new_run.php:40
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
socialnetwork
lib
logpinned.php
Создано системой
1.14.0