1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
app.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\MobileApp
;
4
5
use
Bitrix\Main\Entity
;
6
use Bitrix\Main\Entity\Event;
7
use Bitrix\Main\Entity\FieldError;
8
use Bitrix\Main\Entity\Result;
9
use
Bitrix\Main\Localization\Loc
;
10
use
Bitrix\Main
;
11
12
Loc::loadMessages(__FILE__);
13
44
class
AppTable
extends
Entity\DataManager
45
{
46
public
static
function
getFilePath
()
47
{
48
return
__FILE__;
49
}
50
51
public
static
function
getTableName
()
52
{
53
return
'b_mobileapp_app'
;
54
}
55
56
57
public
static
function
getMap
()
58
{
59
return
array
(
60
new
Entity
\
StringField
(
'CODE'
,
array
(
61
'primary'
=>
true
,
62
'validation'
=>
array
(__CLASS__,
'validateCode'
),
63
'title'
=> Loc::getMessage(
'APP_ENTITY_CODE_FIELD'
),
64
)),
65
new
Entity
\
StringField
(
'SHORT_NAME'
,
array
(
66
'validation'
=>
array
(__CLASS__,
'validateShortName'
),
67
'title'
=> Loc::getMessage(
'APP_ENTITY_SHORT_NAME_FIELD'
),
68
'default_value'
=>
"AppName"
69
)),
70
new
Entity
\
StringField
(
'NAME'
,
array
(
71
'validation'
=>
array
(__CLASS__,
'validateName'
),
72
"require"
=>
true
,
73
'title'
=> Loc::getMessage(
'APP_ENTITY_NAME_FIELD'
),
74
)),
75
new
Entity
\
TextField
(
'DESCRIPTION'
,
array
(
76
'default_value'
=>
"App description placeholder"
,
77
'title'
=> Loc::getMessage(
'APP_ENTITY_DESCRIPTION_FIELD'
),
78
)),
79
new
Entity
\
TextField
(
'FILES'
,
array
(
80
'serialized'
=>
true
,
81
'default_value'
=>
array
(),
82
'title'
=> Loc::getMessage(
'APP_ENTITY_FILES_FIELD'
),
83
)),
84
new
Entity
\
TextField
(
'LAUNCH_ICONS'
,
array
(
85
'serialized'
=>
true
,
86
'default_value'
=>
array
(),
87
'title'
=> Loc::getMessage(
'APP_ENTITY_LAUNCH_ICONS_FIELD'
),
88
)),
89
new
Entity
\
TextField
(
'LAUNCH_SCREENS'
,
array
(
90
'serialized'
=>
true
,
91
'default_value'
=>
array
(),
92
'title'
=> Loc::getMessage(
'APP_ENTITY_LAUNCH_SCREENS_FIELD'
),
93
)),
94
new
Entity
\
StringField
(
'FOLDER'
,
array
(
95
'validation'
=>
array
(__CLASS__,
'validateFolder'
),
96
'require'
=>
true
,
97
'title'
=> Loc::getMessage(
'APP_ENTITY_FOLDER_FIELD'
),
98
)),
99
new
Entity
\
DatetimeField
(
'DATE_CREATE'
,
array
(
100
'default_value'
=>
new
\
Bitrix
\
Main
\
Type
\
Date
,
101
'title'
=> Loc::getMessage(
'APP_ENTITY_DATE_CREATE_FIELD'
),
102
)),
103
new
Entity
\ReferenceField(
104
'CONFIG'
,
105
'Bitrix\MobileApp\Designer\ConfigTable'
,
106
array
(
'=this.CODE'
=>
'ref.APP_CODE'
)
107
)
108
);
109
}
110
111
public
static
function
validateCode
()
112
{
113
return
array
(
114
new
Entity
\Validator\Unique(
null
, 255),
115
);
116
}
117
118
public
static
function
validateShortName
()
119
{
120
return
array
(
121
new
Entity
\Validator\Length(
null
, 20),
122
);
123
}
124
125
public
static
function
validateName
()
126
{
127
return
array
(
128
new
Entity
\Validator\Length(
null
, 255),
129
);
130
}
131
132
public
static
function
validateFolder
()
133
{
134
return
array
(
135
new
Entity
\Validator\Length(
null
, 255),
136
);
137
}
138
139
public
static
function
isAppExists
(
$code
)
140
{
141
$result
= self::getById(
$code
);
142
143
return
(
$result
->getSelectedRowsCount() ?
true
:
false
);
144
}
145
146
public
static
function
onAfterDelete
(
Event
$event
)
147
{
148
$parameters =
$event
->getParameter(
"id"
);
149
$code
= $parameters[
"CODE"
];
150
Designer\ConfigTable::delete(
array
(
"APP_CODE"
=>
$code
));
151
parent::onAfterDelete(
$event
);
152
}
153
154
public
static
function
checkFields
(
Result
$result
, $primary,
array
$data
)
155
{
156
parent::checkFields(
$result
, $primary,
$data
);
157
158
if
(
$result
instanceof
Entity
\
AddResult
)
159
{
160
$entity
= self::getEntity();
161
if
(!
$data
[
"CODE"
])
162
{
163
$result
->addError(
new
Entity
\
FieldError
(
$entity
->getField(
"CODE"
),
"Can not be empty!"
, FieldError::EMPTY_REQUIRED));
164
}
165
elseif
(!
$data
[
"FOLDER"
])
166
{
167
$result
->addError(
new
Entity
\
FieldError
(
$entity
->getField(
"FOLDER"
),
"Can not be empty!"
, FieldError::EMPTY_REQUIRED));
168
}
169
elseif
(!
$data
[
"NAME"
])
170
{
171
$result
->addError(
new
Entity
\
FieldError
(
$entity
->getField(
"NAME"
),
"Can not be empty!"
, FieldError::EMPTY_REQUIRED));
172
}
173
174
}
175
}
176
177
public
static
function
getSupportedPlatforms
()
178
{
179
return
array
(
180
"android"
,
181
"ios"
,
182
);
183
}
184
185
186
}
Bitrix\Main\Event
Определения
event.php:5
Bitrix\Main\Localization\Loc
Определения
loc.php:12
Bitrix\Main\ORM\Data\AddResult
Определения
addresult.php:12
Bitrix\Main\ORM\Data\Result
Определения
result.php:16
Bitrix\Main\ORM\Fields\DatetimeField
Определения
datetimefield.php:22
Bitrix\Main\ORM\Fields\FieldError
Определения
fielderror.php:14
Bitrix\Main\ORM\Fields\StringField
Определения
stringfield.php:20
Bitrix\Main\ORM\Fields\TextField
Определения
textfield.php:20
Bitrix\Main\Type\Date
Определения
date.php:9
Bitrix\MobileApp\AppTable
Определения
app.php:45
Bitrix\MobileApp\AppTable\validateShortName
static validateShortName()
Определения
app.php:118
Bitrix\MobileApp\AppTable\getMap
static getMap()
Определения
app.php:57
Bitrix\MobileApp\AppTable\isAppExists
static isAppExists($code)
Определения
app.php:139
Bitrix\MobileApp\AppTable\getFilePath
static getFilePath()
Определения
app.php:46
Bitrix\MobileApp\AppTable\checkFields
static checkFields(Result $result, $primary, array $data)
Определения
app.php:154
Bitrix\MobileApp\AppTable\onAfterDelete
static onAfterDelete(Event $event)
Определения
app.php:146
Bitrix\MobileApp\AppTable\validateFolder
static validateFolder()
Определения
app.php:132
Bitrix\MobileApp\AppTable\getSupportedPlatforms
static getSupportedPlatforms()
Определения
app.php:177
Bitrix\MobileApp\AppTable\validateName
static validateName()
Определения
app.php:125
Bitrix\MobileApp\AppTable\getTableName
static getTableName()
Определения
app.php:51
Bitrix\MobileApp\AppTable\validateCode
static validateCode()
Определения
app.php:111
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
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
$entity
$entity
Определения
group_bizproc_workflow_delete.php:17
$code
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения
options.php:195
Bitrix\Main\Entity
Определения
ufield.php:9
Bitrix\Main\Type
Определения
collection.php:2
Bitrix\Main
Bitrix\MobileApp
Определения
app.php:3
Bitrix
$event
$event
Определения
prolog_after.php:141
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
mobileapp
lib
app.php
Создано системой
1.14.0