Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
groupstate.php
1
<?php
8
namespace
Bitrix\Sender\Internals\Model
;
9
10
use
Bitrix\Main\Access\Entity\DataManager
;
11
use
Bitrix\Main\Localization\Loc
;
12
13
Loc::loadMessages
(__FILE__);
14
31
class
GroupStateTable
extends
DataManager
32
{
33
const
STATES
= [
34
'CREATED'
=> 1,
35
'IN_PROGRESS'
=> 2,
36
'COMPLETED'
=> 3,
37
'HALTED'
=> 4,
38
];
39
45
public
static
function
getTableName
()
46
{
47
return
'b_sender_group_state'
;
48
}
49
55
public
static
function
getMap
()
56
{
57
return
array(
58
'ID'
=> array(
59
'data_type'
=>
'integer'
,
60
'autocomplete'
=>
true
,
61
'primary'
=>
true
,
62
),
63
'DATE_INSERT'
=> array(
64
'data_type'
=>
'datetime'
,
65
),
66
'STATE'
=> array(
67
'data_type'
=>
'integer'
,
68
),
69
'FILTER_ID'
=> array(
70
'data_type'
=>
'string'
,
71
),
72
'ENDPOINT'
=> array(
73
'data_type'
=>
'string'
,
74
),
75
'GROUP'
=> array(
76
'data_type'
=>
'Bitrix\Sender\GroupTable'
,
77
'reference'
=> array(
'=this.GROUP_ID'
=>
'ref.ID'
),
78
),
79
'GROUP_ID'
=> array(
80
'data_type'
=>
'integer'
,
81
'required'
=>
true
,
82
),
83
'OFFSET'
=> array(
84
'data_type'
=>
'integer'
,
85
)
86
);
87
}
88
96
public
static
function
onDelete
(\
Bitrix
\Main\
Entity
\
Event
$event)
97
{
98
$result = new \Bitrix\Main\Entity\EventResult;
99
$data = $event->getParameters();
100
101
$listId = array();
102
if
(array_key_exists(
'ID'
, $data[
'primary'
]))
103
{
104
$listId[] = $data[
'primary'
][
'ID'
];
105
}
106
else
107
{
108
$filter = array();
109
foreach
($data[
'primary'
] as $primKey => $primVal)
110
{
111
$filter[$primKey] = $primVal;
112
}
113
114
$tableDataList = static::getList(array(
115
'select'
=> array(
'ID'
),
116
'filter'
=> $filter
117
));
118
while
($tableData = $tableDataList->fetch())
119
{
120
$listId[] = $tableData[
'ID'
];
121
}
122
123
}
124
125
foreach
($listId as $primaryId)
126
{
127
$primary = array(
'GROUP_STATE_ID'
=> $primaryId);
128
GroupThreadTable::deleteList
($primary);
129
}
130
131
return
$result;
132
}
133
}
Bitrix\Main\Access\Entity\DataManager
Definition
datamanager.php:15
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Sender\Internals\Model\GroupStateTable
Definition
groupstate.php:32
Bitrix\Sender\Internals\Model\GroupStateTable\getMap
static getMap()
Definition
groupstate.php:55
Bitrix\Sender\Internals\Model\GroupStateTable\STATES
const STATES
Definition
groupstate.php:33
Bitrix\Sender\Internals\Model\GroupStateTable\onDelete
static onDelete(\Bitrix\Main\Entity\Event $event)
Definition
groupstate.php:96
Bitrix\Sender\Internals\Model\GroupStateTable\getTableName
static getTableName()
Definition
groupstate.php:45
Bitrix\Sender\Internals\Model\GroupThreadTable\deleteList
static deleteList(array $filter)
Definition
groupthread.php:92
Bitrix\Sender\Internals\Model
Definition
abuse.php:3
Bitrix
modules
sender
lib
internals
model
groupstate.php
Создано системой
1.10.0