Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
applang.php
1
<?php
2
namespace
Bitrix\Rest
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Rest\Preset\EventController
;
6
33
class
AppLangTable
extends
Main\Entity\DataManager
34
{
40
public
static
function
getTableName
()
41
{
42
return
'b_rest_app_lang'
;
43
}
44
50
public
static
function
getMap
()
51
{
52
return
array(
53
'ID'
=> array(
54
'data_type'
=>
'integer'
,
55
'primary'
=>
true
,
56
),
57
'APP_ID'
=> array(
58
'data_type'
=>
'integer'
,
59
'required'
=>
true
,
60
),
61
'LANGUAGE_ID'
=> array(
62
'data_type'
=>
'string'
,
63
'required'
=>
true
,
64
'validation'
=> array(__CLASS__,
'validateLanguageId'
),
65
),
66
'MENU_NAME'
=> array(
67
'data_type'
=>
'string'
,
68
'validation'
=> array(__CLASS__,
'validateMenuName'
),
69
),
70
'APP'
=> array(
71
'data_type'
=>
'Bitrix\Rest\AppTable'
,
72
'reference'
=> array(
'=this.APP_ID'
=>
'ref.ID'
),
73
),
74
);
75
}
76
77
public
static
function
deleteByApp
($appId)
78
{
79
$connection = Main\Application::getConnection();
80
return
$connection->query(
"DELETE FROM "
.static::getTableName().
" WHERE APP_ID='"
.intval($appId).
"'"
);
81
}
82
88
public
static
function
validateLanguageId
()
89
{
90
return
array(
91
new
Main\
Entity
\Validator\Length(
null
, 2),
92
);
93
}
94
100
public
static
function
validateMenuName
()
101
{
102
return
array(
103
new
Main\
Entity
\Validator\Length(
null
, 500),
104
);
105
}
106
107
public
static
function
onAfterAdd
(Main\
Entity
\
Event
$event)
108
{
109
EventController::onAddAppLang($event);
110
}
111
}
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Rest\AppLangTable
Definition
applang.php:34
Bitrix\Rest\AppLangTable\getMap
static getMap()
Definition
applang.php:50
Bitrix\Rest\AppLangTable\validateLanguageId
static validateLanguageId()
Definition
applang.php:88
Bitrix\Rest\AppLangTable\validateMenuName
static validateMenuName()
Definition
applang.php:100
Bitrix\Rest\AppLangTable\deleteByApp
static deleteByApp($appId)
Definition
applang.php:77
Bitrix\Rest\AppLangTable\onAfterAdd
static onAfterAdd(Main\Entity\Event $event)
Definition
applang.php:107
Bitrix\Rest\AppLangTable\getTableName
static getTableName()
Definition
applang.php:40
Bitrix\Rest\Preset\EventController
Definition
eventcontroller.php:15
Bitrix\Main
Bitrix\Rest
Definition
accessexception.php:2
modules
rest
lib
applang.php
Создано системой
1.10.0