Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
groupcounter.php
1
<?php
8
namespace
Bitrix\Sender\Internals\Model
;
9
10
use
Bitrix\Main\Entity
;
11
use
Bitrix\Main\Localization\Loc
;
12
use
Bitrix\Main\ORM\Query\Query
;
13
14
Loc::loadMessages
(__FILE__);
15
32
class
GroupCounterTable
extends
Entity\DataManager
33
{
39
public
static
function
getTableName
()
40
{
41
return
'b_sender_group_counter'
;
42
}
43
49
public
static
function
getMap
()
50
{
51
return
array(
52
'GROUP_ID'
=> array(
53
'data_type'
=>
'integer'
,
54
'required'
=>
true
,
55
'primary'
=>
true
,
56
),
57
'TYPE_ID'
=> array(
58
'data_type'
=>
'integer'
,
59
'required'
=>
true
,
60
'primary'
=>
true
,
61
),
62
63
'CNT'
=> array(
64
'data_type'
=>
'integer'
,
65
'required'
=>
true
,
66
'default_value'
=> 0,
67
),
68
'GROUP'
=> array(
69
'data_type'
=>
'Bitrix\Sender\GroupTable'
,
70
'reference'
=> array(
'=this.GROUP_ID'
=>
'ref.ID'
),
71
),
72
);
73
}
74
81
public
static
function
deleteByGroupId
($groupId)
82
{
83
$items = static::getList([
84
'select'
=> [
'GROUP_ID'
,
'TYPE_ID'
],
85
'filter'
=> [
'=GROUP_ID'
=> $groupId]
86
]);
87
foreach
($items as $primary)
88
{
89
$result = static::delete($primary);
90
if
(!$result->isSuccess())
91
{
92
return
false
;
93
}
94
}
95
96
return
true
;
97
}
105
public
static
function
deleteList
(array $filter)
106
{
107
$entity = static::getEntity();
108
$connection = $entity->getConnection();
109
110
\CTimeZone::disable();
111
$sql = sprintf(
112
'DELETE FROM %s WHERE %s'
,
113
$connection->getSqlHelper()->quote($entity->getDbTableName()),
114
Query::buildFilterSql($entity, $filter)
115
);
116
$res = $connection->query($sql);
117
\CTimeZone::enable();
118
119
return
$res;
120
}
121
}
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\Main\ORM\Query\Query
Definition
query.php:118
Bitrix\Sender\Internals\Model\GroupCounterTable
Definition
groupcounter.php:33
Bitrix\Sender\Internals\Model\GroupCounterTable\getMap
static getMap()
Definition
groupcounter.php:49
Bitrix\Sender\Internals\Model\GroupCounterTable\deleteList
static deleteList(array $filter)
Definition
groupcounter.php:105
Bitrix\Sender\Internals\Model\GroupCounterTable\deleteByGroupId
static deleteByGroupId($groupId)
Definition
groupcounter.php:81
Bitrix\Sender\Internals\Model\GroupCounterTable\getTableName
static getTableName()
Definition
groupcounter.php:39
Bitrix\Sender\Internals\Model
Definition
abuse.php:3
modules
sender
lib
internals
model
groupcounter.php
Создано системой
1.10.0