Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
userrelations.php
1
<?php
8
namespace
Bitrix\Socialnetwork
;
9
10
use
Bitrix\Main\Entity
;
11
28
class
UserRelationsTable
extends
Entity\DataManager
29
{
30
const
RELATION_FRIEND
= SONET_RELATIONS_FRIEND;
31
const
RELATION_REQUEST
= SONET_RELATIONS_REQUEST;
32
const
RELATION_BAN
= SONET_RELATIONS_BAN;
33
34
const
INITIATED_BY_FIRST
=
'F'
;
35
const
INITIATED_BY_SECOND
=
'S'
;
36
37
public
static
function
getFilePath
()
38
{
39
return
__FILE__;
40
}
41
42
public
static
function
getTableName
()
43
{
44
return
'b_sonet_user_relations'
;
45
}
46
47
public
static
function
getMap
()
48
{
49
return
array(
50
'ID'
=> array(
51
'data_type'
=>
'integer'
,
52
'primary'
=>
true
,
53
'autocomplete'
=>
true
,
54
),
55
'FIRST_USER_ID'
=> array(
56
'data_type'
=>
'integer'
,
57
),
58
'SECOND_USER_ID'
=> array(
59
'data_type'
=>
'integer'
,
60
),
61
'RELATION'
=> array(
62
'data_type'
=>
'enum'
,
63
'required'
=>
true
,
64
'values'
=> array(self::RELATION_FRIEND, self::RELATION_REQUEST, self::RELATION_BAN),
65
),
66
'INITIATED_BY'
=> array(
67
'data_type'
=>
'enum'
,
68
'required'
=>
true
,
69
'values'
=> array(self::INITIATED_BY_FIRST, self::INITIATED_BY_SECOND)
70
),
71
'DATE_CREATE'
=> array(
72
'data_type'
=>
'datetime'
,
73
),
74
'DATE_UPDATE'
=> array(
75
'data_type'
=>
'datetime'
,
76
),
77
'MESSAGE'
=> array(
78
'data_type'
=>
'text'
,
79
),
80
'FIRST_USER'
=> array(
81
'data_type'
=>
'Bitrix\Main\UserTable'
,
82
'reference'
=> array(
'=this.FIRST_USER_ID'
=>
'ref.ID'
),
83
),
84
'SECOND_USER'
=> array(
85
'data_type'
=>
'Bitrix\Main\UserTable'
,
86
'reference'
=> array(
'=this.SECOND_USER_ID'
=>
'ref.ID'
),
87
),
88
);
89
}
90
91
public
static
function
getUserFilter
($operation, $field, $filter)
92
{
93
return
array(
94
'LOGIC'
=>
'OR'
,
95
$operation.preg_replace(
'/^USER/'
,
'FIRST_USER'
, $field) => $filter,
96
$operation.preg_replace(
'/^USER/'
,
'SECOND_USER'
, $field) => $filter,
97
);
98
}
99
}
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Socialnetwork\UserRelationsTable
Definition
userrelations.php:29
Bitrix\Socialnetwork\UserRelationsTable\getMap
static getMap()
Definition
userrelations.php:47
Bitrix\Socialnetwork\UserRelationsTable\getFilePath
static getFilePath()
Definition
userrelations.php:37
Bitrix\Socialnetwork\UserRelationsTable\RELATION_FRIEND
const RELATION_FRIEND
Definition
userrelations.php:30
Bitrix\Socialnetwork\UserRelationsTable\INITIATED_BY_SECOND
const INITIATED_BY_SECOND
Definition
userrelations.php:35
Bitrix\Socialnetwork\UserRelationsTable\RELATION_REQUEST
const RELATION_REQUEST
Definition
userrelations.php:31
Bitrix\Socialnetwork\UserRelationsTable\INITIATED_BY_FIRST
const INITIATED_BY_FIRST
Definition
userrelations.php:34
Bitrix\Socialnetwork\UserRelationsTable\getUserFilter
static getUserFilter($operation, $field, $filter)
Definition
userrelations.php:91
Bitrix\Socialnetwork\UserRelationsTable\RELATION_BAN
const RELATION_BAN
Definition
userrelations.php:32
Bitrix\Socialnetwork\UserRelationsTable\getTableName
static getTableName()
Definition
userrelations.php:42
Bitrix\Socialnetwork
modules
socialnetwork
lib
userrelations.php
Создано системой
1.10.0