Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
statapp.php
1
<?php
2
namespace
Bitrix\Rest
;
3
4
use
Bitrix\Main
,
5
Bitrix\Main\Localization\Loc
;
6
Loc::loadMessages
(__FILE__);
7
34
class
StatAppTable
extends
Main\Entity\DataManager
35
{
41
public
static
function
getTableName
()
42
{
43
return
'b_rest_stat_app'
;
44
}
45
51
public
static
function
getMap
()
52
{
53
return
array(
54
'APP_ID'
=> array(
55
'data_type'
=>
'integer'
,
56
'primary'
=>
true
,
57
'title'
=>
Loc::getMessage
(
'STAT_APP_ENTITY_APP_ID_FIELD'
),
58
),
59
'APP_CODE'
=> array(
60
'data_type'
=>
'string'
,
61
'required'
=>
true
,
62
'validation'
=> array(__CLASS__,
'validateAppCode'
),
63
'title'
=>
Loc::getMessage
(
'STAT_APP_ENTITY_APP_CODE_FIELD'
),
64
),
65
'APP'
=> array(
66
'data_type'
=>
'Bitrix\Rest\App'
,
67
'reference'
=> array(
'=this.APP_ID'
=>
'ref.ID'
),
68
),
69
);
70
}
76
public
static
function
validateAppCode
()
77
{
78
return
array(
79
new
Main\
Entity
\Validator\Length(
null
, 128),
80
);
81
}
87
public
static
function
register
($appInfo)
88
{
89
$connection = Main\Application::getConnection();
90
$helper = $connection->getSqlHelper();
91
$queries = $helper->prepareMerge(
92
static::getTableName(),
93
array(
'APP_ID'
),
94
array(
'APP_ID'
=> $appInfo[
'ID'
],
'APP_CODE'
=> $appInfo[
'CODE'
]),
95
array(
'APP_CODE'
=> $appInfo[
'CODE'
])
96
);
97
foreach
($queries as $query)
98
{
99
$connection->queryExecute($query);
100
}
101
}
102
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Rest\StatAppTable
Definition
statapp.php:35
Bitrix\Rest\StatAppTable\getMap
static getMap()
Definition
statapp.php:51
Bitrix\Rest\StatAppTable\validateAppCode
static validateAppCode()
Definition
statapp.php:76
Bitrix\Rest\StatAppTable\getTableName
static getTableName()
Definition
statapp.php:41
Bitrix\Main
Bitrix\Rest
Definition
accessexception.php:2
modules
rest
lib
statapp.php
Создано системой
1.10.0