1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
access.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Sender\Internals\Model\Role
;
4
5
use
Bitrix\Main\ArgumentException
;
6
use
Bitrix\Main\Application
;
7
use
Bitrix\Main\Entity
;
8
27
class
AccessTable
extends
Entity\DataManager
28
{
35
public
static
function
getTableName
()
36
{
37
return
'b_sender_role_access'
;
38
}
39
46
public
static
function
getMap
()
47
{
48
return
array
(
49
'ID'
=>
new
Entity
\
IntegerField
(
'ID'
,
array
(
50
'primary'
=>
true
,
51
'autocomplete'
=>
true
,
52
)),
53
'ROLE_ID'
=>
new
Entity
\
IntegerField
(
'ROLE_ID'
,
array
(
54
'required'
=>
true
,
55
)),
56
'ACCESS_CODE'
=>
new
Entity
\
StringField
(
'ACCESS_CODE'
,
array
(
57
'required'
=>
true
,
58
)),
59
'ROLE'
=>
new
Entity
\ReferenceField(
60
'ROLE'
,
'Bitrix\Sender\Access\Role\Role'
,
61
array
(
'=this.ROLE_ID'
=>
'ref.ID'
),
62
array
(
'join_type'
=>
'INNER'
)
63
)
64
);
65
}
66
72
public
static
function
truncate
()
73
{
74
$sql =
"TRUNCATE TABLE "
.
self::getTableName
();
75
Application::getConnection()->queryExecute($sql);
76
77
$result
=
new
Entity\DeleteResult
();
78
return
$result
;
79
}
80
88
public
static
function
deleteByRoleId
($roleId)
89
{
90
$roleId = (int) $roleId;
91
if
($roleId <= 0)
92
{
93
throw
new
ArgumentException
(
'Role id should be greater than zero'
,
'roleId'
);
94
}
95
96
$sql =
"DELETE FROM "
.
self::getTableName
() .
" WHERE ROLE_ID = "
. $roleId;
97
Application::getConnection()->queryExecute($sql);
98
99
$result
=
new
Entity\DeleteResult
();
100
return
$result
;
101
}
102
}
Bitrix\Main\Application
Определения
application.php:30
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Main\ORM\Data\DeleteResult
Определения
deleteresult.php:12
Bitrix\Main\ORM\Fields\IntegerField
Определения
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Определения
stringfield.php:20
Bitrix\Sender\Internals\Model\Role\AccessTable
Определения
access.php:28
Bitrix\Sender\Internals\Model\Role\AccessTable\deleteByRoleId
static deleteByRoleId($roleId)
Определения
access.php:88
Bitrix\Sender\Internals\Model\Role\AccessTable\getMap
static getMap()
Определения
access.php:46
Bitrix\Sender\Internals\Model\Role\AccessTable\truncate
static truncate()
Определения
access.php:72
Bitrix\Sender\Internals\Model\Role\AccessTable\getTableName
static getTableName()
Определения
access.php:35
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
Bitrix\Main\Entity
Определения
ufield.php:9
Bitrix\Sender\Internals\Model\Role
Определения
access.php:3
bitrix
modules
sender
lib
internals
model
role
access.php
Создано системой
1.14.0