Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
buttonsitetable.php
1
<?php
2
namespace
Bitrix\B24connector
;
3
4
use
Bitrix\Main\ORM\Data\DataManager
;
5
use
Bitrix\Main\ORM\Fields\IntegerField
;
6
use
Bitrix\Main\ORM\Fields\StringField
;
7
24
class
ButtonSiteTable
extends
DataManager
25
{
30
public
static
function
getTableName
()
31
{
32
return
'b_b24connector_button_site'
;
33
}
34
40
public
static
function
getMap
()
41
{
42
return
[
43
new
IntegerField
(
'ID'
, [
44
'primary'
=>
true
,
45
'autocomplete'
=>
true
,
46
]),
47
new
IntegerField
(
'BUTTON_ID'
, [
48
'required'
=>
true
,
49
]),
50
new
StringField
(
'SITE_ID'
, [
51
'required'
=>
true
,
52
]),
53
];
54
}
55
60
public
static
function
getAllRestrictions
()
61
{
62
$result = [];
63
$rows = static::getList();
64
while
($row = $rows->fetch())
65
{
66
$buttonId = $row[
'BUTTON_ID'
];
67
$siteId = $row[
'SITE_ID'
];
68
69
if
(!isset($result[$buttonId]))
70
{
71
$result[$buttonId] = [];
72
}
73
74
$result[$buttonId][] = $siteId;
75
}
76
return
$result;
77
}
78
79
public
static
function
deleteByButtonId
($buttonId)
80
{
81
$buttonId = (int)$buttonId;
82
if
($buttonId <= 0)
83
{
84
return
;
85
}
86
87
$rows = static::getList([
88
'select'
=> [
'ID'
],
89
'filter'
=> [
'=BUTTON_ID'
=> $buttonId]
90
]);
91
while
($row = $rows->fetch())
92
{
93
static::delete($row[
'ID'
]);
94
}
95
}
96
}
Bitrix\B24connector\ButtonSiteTable
Definition
buttonsitetable.php:25
Bitrix\B24connector\ButtonSiteTable\deleteByButtonId
static deleteByButtonId($buttonId)
Definition
buttonsitetable.php:79
Bitrix\B24connector\ButtonSiteTable\getMap
static getMap()
Definition
buttonsitetable.php:40
Bitrix\B24connector\ButtonSiteTable\getAllRestrictions
static getAllRestrictions()
Definition
buttonsitetable.php:60
Bitrix\B24connector\ButtonSiteTable\getTableName
static getTableName()
Definition
buttonsitetable.php:30
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\B24connector
Definition
buttonsitetable.php:2
modules
b24connector
lib
buttonsitetable.php
Создано системой
1.10.0