Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
workgrouppin.php
1
<?php
8
namespace
Bitrix\Socialnetwork
;
9
10
use
Bitrix\Main\Entity
;
11
use
Bitrix\Socialnetwork\Internals\Pin\Pin
;
12
use
Bitrix\Socialnetwork\Internals\Pin\PinCollection
;
13
30
class
WorkgroupPinTable
extends
Entity\DataManager
31
{
32
public
static
function
getTableName
(): string
33
{
34
return
'b_sonet_group_pin'
;
35
}
36
37
public
static
function
getMap
(): array
38
{
39
return
[
40
'ID'
=> [
41
'data_type'
=>
'integer'
,
42
'primary'
=>
true
,
43
'autocomplete'
=>
true
,
44
],
45
'USER_ID'
=> [
46
'data_type'
=>
'integer'
,
47
],
48
'USER'
=> [
49
'data_type'
=>
'\Bitrix\Main\User'
,
50
'reference'
=> [
'=this.USER_ID'
=>
'ref.ID'
],
51
],
52
'GROUP_ID'
=> [
53
'data_type'
=>
'integer'
,
54
],
55
'GROUP'
=> [
56
'data_type'
=>
'\Bitrix\Socialnetwork\Workgroup'
,
57
'reference'
=> [
'=this.GROUP_ID'
=>
'ref.ID'
],
58
],
59
'CONTEXT'
=> [
60
'data_type'
=>
'string'
,
61
],
62
];
63
}
64
65
public
static
function
getSelectExpression
(): string
66
{
67
$tableName = static::getTableName();
68
69
return
"
70
CASE WHEN
71
EXISTS(
72
SELECT 'x'
73
FROM {$tableName}
74
WHERE
75
GROUP_ID = %s
76
AND USER_ID = %s
77
AND CONTEXT = %s
78
)
79
THEN 'Y'
80
ELSE 'N'
81
END
82
"
;
83
}
84
85
public
static
function
getObjectClass
(): string
86
{
87
return
Pin::class;
88
}
89
90
public
static
function
getCollectionClass
(): string
91
{
92
return
PinCollection::class;
93
}
94
}
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Socialnetwork\Internals\Pin\PinCollection
Definition
pincollection.php:8
Bitrix\Socialnetwork\Internals\Pin\Pin
Definition
pin.php:8
Bitrix\Socialnetwork\WorkgroupPinTable
Definition
workgrouppin.php:31
Bitrix\Socialnetwork\WorkgroupPinTable\getSelectExpression
static getSelectExpression()
Definition
workgrouppin.php:65
Bitrix\Socialnetwork\WorkgroupPinTable\getMap
static getMap()
Definition
workgrouppin.php:37
Bitrix\Socialnetwork\WorkgroupPinTable\getObjectClass
static getObjectClass()
Definition
workgrouppin.php:85
Bitrix\Socialnetwork\WorkgroupPinTable\getTableName
static getTableName()
Definition
workgrouppin.php:32
Bitrix\Socialnetwork\WorkgroupPinTable\getCollectionClass
static getCollectionClass()
Definition
workgrouppin.php:90
Bitrix\Socialnetwork
modules
socialnetwork
lib
workgrouppin.php
Создано системой
1.10.0