Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
messageaccess.php
1
<?php
2
3
namespace
Bitrix\Mail\Internals
;
4
5
use
Bitrix\Main\Entity
;
6
use Bitrix\Main\ORM\Data\Internal\DeleteByFilterTrait;
7
24
class
MessageAccessTable
extends
Entity\DataManager
25
{
26
use DeleteByFilterTrait;
27
28
const
ENTITY_TYPE_NO_BIND
=
'NO_BIND'
;
29
const
ENTITY_TYPE_TASKS_TASK
=
'TASKS_TASK'
;
30
const
ENTITY_TYPE_CRM_ACTIVITY
=
'CRM_ACTIVITY'
;
31
const
ENTITY_TYPE_BLOG_POST
=
'BLOG_POST'
;
32
const
ENTITY_TYPE_IM_CHAT
=
'IM_CHAT'
;
33
const
ENTITY_TYPE_CALENDAR_EVENT
=
'CALENDAR_EVENT'
;
34
35
public
static
function
getFilePath
()
36
{
37
return
__FILE__;
38
}
39
40
public
static
function
getTableName
()
41
{
42
return
'b_mail_message_access'
;
43
}
44
45
public
static
function
getMap
()
46
{
47
return
array(
48
'TOKEN'
=> array(
49
'data_type'
=>
'string'
,
50
'primary'
=>
true
,
51
),
52
'MAILBOX_ID'
=> array(
53
'data_type'
=>
'integer'
,
54
'required'
=>
true
,
55
),
56
'MESSAGE_ID'
=> array(
57
'data_type'
=>
'integer'
,
58
'required'
=>
true
,
59
),
60
'ENTITY_UF_ID'
=> array(
61
'data_type'
=>
'integer'
,
62
'required'
=>
true
,
63
),
64
'ENTITY_TYPE'
=> array(
65
'data_type'
=>
'string'
,
66
'required'
=>
true
,
67
),
68
'ENTITY_ID'
=> array(
69
'data_type'
=>
'integer'
,
70
'required'
=>
true
,
71
),
72
'SECRET'
=> array(
73
'data_type'
=>
'string'
,
74
'required'
=>
true
,
75
),
76
'OPTIONS'
=> array(
77
'data_type'
=>
'text'
,
78
'serialized'
=>
true
,
79
),
80
new
Entity
\ReferenceField(
81
'CRM_ACTIVITY'
,
82
'\Bitrix\Crm\ActivityTable'
,
83
array(
84
'=this.ENTITY_TYPE'
=> array(
'?s'
, self::ENTITY_TYPE_CRM_ACTIVITY),
85
'=this.ENTITY_ID'
=>
'ref.ID'
,
86
)
87
),
88
);
89
}
90
91
100
public
static
function
getBinds
(
int
$mailboxId,
int
$messageId): array
101
{
102
$binds =
MessageAccessTable::query
()
103
->where(
'MAILBOX_ID'
, $mailboxId)
104
->where(
'MESSAGE_ID'
, $messageId)
105
->setDistinct()
106
->setSelect([
107
'ENTITY_TYPE'
,
108
'ENTITY_ID'
,
109
])
110
->fetchAll();
111
112
return
array_map(fn(array $bind):
string
=>
"{$bind['ENTITY_TYPE']}-{$bind['ENTITY_ID']}"
, $binds);
113
}
114
115
}
Bitrix\Mail\Internals\MessageAccessTable
Definition
messageaccess.php:25
Bitrix\Mail\Internals\MessageAccessTable\getMap
static getMap()
Definition
messageaccess.php:45
Bitrix\Mail\Internals\MessageAccessTable\ENTITY_TYPE_CALENDAR_EVENT
const ENTITY_TYPE_CALENDAR_EVENT
Definition
messageaccess.php:33
Bitrix\Mail\Internals\MessageAccessTable\getBinds
static getBinds(int $mailboxId, int $messageId)
Definition
messageaccess.php:100
Bitrix\Mail\Internals\MessageAccessTable\getFilePath
static getFilePath()
Definition
messageaccess.php:35
Bitrix\Mail\Internals\MessageAccessTable\ENTITY_TYPE_NO_BIND
const ENTITY_TYPE_NO_BIND
Definition
messageaccess.php:28
Bitrix\Mail\Internals\MessageAccessTable\ENTITY_TYPE_BLOG_POST
const ENTITY_TYPE_BLOG_POST
Definition
messageaccess.php:31
Bitrix\Mail\Internals\MessageAccessTable\ENTITY_TYPE_CRM_ACTIVITY
const ENTITY_TYPE_CRM_ACTIVITY
Definition
messageaccess.php:30
Bitrix\Mail\Internals\MessageAccessTable\ENTITY_TYPE_IM_CHAT
const ENTITY_TYPE_IM_CHAT
Definition
messageaccess.php:32
Bitrix\Mail\Internals\MessageAccessTable\ENTITY_TYPE_TASKS_TASK
const ENTITY_TYPE_TASKS_TASK
Definition
messageaccess.php:29
Bitrix\Mail\Internals\MessageAccessTable\getTableName
static getTableName()
Definition
messageaccess.php:40
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Data\DataManager\query
static query()
Definition
datamanager.php:559
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Mail\Internals
Definition
domainemail.php:3
modules
mail
lib
internals
messageaccess.php
Создано системой
1.10.0