1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
workgroupview.php
См. документацию.
1
<?php
8
namespace
Bitrix\Socialnetwork;
9
10
use Bitrix\Main;
11
use Bitrix\Main\Entity;
12
use Bitrix\Main\NotImplementedException;
13
30
class
WorkgroupViewTable
extends
Entity\DataManager
31
{
32
public
static
function
getTableName
()
33
{
34
return
'b_sonet_group_view'
;
35
}
36
37
public
static
function
getMap
()
38
{
39
$fieldsMap =
array
(
40
'USER_ID'
=>
array
(
41
'data_type'
=>
'integer'
,
42
'primary'
=>
true
43
),
44
'USER'
=>
array
(
45
'data_type'
=>
'\Bitrix\Main\User'
,
46
'reference'
=>
array
(
'=this.USER_ID'
=>
'ref.ID'
)
47
),
48
'GROUP_ID'
=>
array
(
49
'data_type'
=>
'integer'
,
50
'primary'
=>
true
51
),
52
'GROUP'
=>
array
(
53
'data_type'
=>
'\Bitrix\Socialnetwork\Workgroup'
,
54
'reference'
=>
array
(
'=this.GROUP_ID'
=>
'ref.ID'
)
55
),
56
'DATE_VIEW'
=>
array
(
57
'data_type'
=>
'datetime'
58
),
59
);
60
61
return
$fieldsMap;
62
}
63
64
public
static
function
set
(
$params
=
array
())
65
{
66
global
$USER
,
$CACHE_MANAGER
;
67
68
if
(
69
!is_array(
$params
)
70
|| !isset(
$params
[
'GROUP_ID'
])
71
|| intval(
$params
[
'GROUP_ID'
]) <= 0
72
)
73
{
74
throw
new
Main\SystemException
(
"Empty groupId."
);
75
}
76
77
$groupId = intval(
$params
[
'GROUP_ID'
]);
78
79
$userId
= (
80
isset(
$params
[
'USER_ID'
])
81
&& intval(
$params
[
'USER_ID'
]) > 0
82
? intval(
$params
[
'USER_ID'
])
83
:
$USER
->getId()
84
);
85
86
if
(intval(
$userId
) <= 0)
87
{
88
throw
new
Main\SystemException
(
"Empty userId."
);
89
}
90
91
$connection
=
\Bitrix\Main\Application::getConnection
();
92
$helper =
$connection
->getSqlHelper();
93
94
$insertFields =
array
(
95
"USER_ID"
=>
$userId
,
96
"GROUP_ID"
=> $groupId,
97
"DATE_VIEW"
=>
new
\
Bitrix
\
Main
\
DB
\
SqlExpression
($helper->getCurrentDateTimeFunction()),
98
);
99
100
$updateFields =
array
(
101
"DATE_VIEW"
=>
new
\
Bitrix
\
Main
\
DB
\
SqlExpression
($helper->getCurrentDateTimeFunction()),
102
);
103
104
$merge = $helper->prepareMerge(
105
static::getTableName(),
106
array
(
"USER_ID"
,
"GROUP_ID"
),
107
$insertFields,
108
$updateFields
109
);
110
111
if
($merge[0] !=
""
)
112
{
113
$connection
->query($merge[0]);
114
}
115
116
if
(defined(
"BX_COMP_MANAGED_CACHE"
))
117
{
118
$CACHE_MANAGER
->ClearByTag(
"sonet_group_view_U"
.
$userId
);
119
}
120
}
121
122
public
static
function
add
(
array
$data
)
123
{
124
throw
new
NotImplementedException
(
"Use set() method of the class."
);
125
}
126
127
public
static
function
update
($primary,
array
$data
)
128
{
129
throw
new
NotImplementedException
(
"Use set() method of the class."
);
130
}
131
}
$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\DB\SqlExpression
Определения
sqlexpression.php:21
Bitrix\Main\NotImplementedException
Определения
NotImplementedException.php:9
Bitrix\Main\SystemException
Определения
SystemException.php:9
Bitrix\Socialnetwork\WorkgroupViewTable
Определения
workgroupview.php:31
Bitrix\Socialnetwork\WorkgroupViewTable\getMap
static getMap()
Определения
workgroupview.php:37
Bitrix\Socialnetwork\WorkgroupViewTable\add
static add(array $data)
Определения
workgroupview.php:122
Bitrix\Socialnetwork\WorkgroupViewTable\update
static update($primary, array $data)
Определения
workgroupview.php:127
Bitrix\Socialnetwork\WorkgroupViewTable\getTableName
static getTableName()
Определения
workgroupview.php:32
$CACHE_MANAGER
global $CACHE_MANAGER
Определения
clear_component_cache.php:7
$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
Bitrix\Main\DB
Определения
arrayresult.php:2
Bitrix\Main
Bitrix
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
socialnetwork
lib
workgroupview.php
Создано системой
1.14.0