Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sectiontable.php
1<?php
2
4
13
62class SectionTable extends Main\Entity\DataManager
63{
69 public static function getTableName()
70 {
71 return 'b_calendar_section';
72 }
73
79 public static function getMap()
80 {
81 return [
82 (new IntegerField('ID'))
83 ->configureTitle(Loc::getMessage('SECTION_ENTITY_ID_FIELD'))
84 ->configurePrimary(true)
85 ->configureAutocomplete(true)
86 ,
87 (new StringField('NAME',
88 [
89 'validation' => [__CLASS__, 'validateName']
90 ]
91 ))
92 ->configureTitle(Loc::getMessage('SECTION_ENTITY_NAME_FIELD'))
93 ,
94 (new StringField('XML_ID',
95 [
96 'validation' => [__CLASS__, 'validateXmlId']
97 ]
98 ))
99 ->configureTitle(Loc::getMessage('SECTION_ENTITY_XML_ID_FIELD'))
100 ,
101 (new StringField('EXTERNAL_ID',
102 [
103 'validation' => [__CLASS__, 'validateExternalId']
104 ]
105 ))
106 ->configureTitle(Loc::getMessage('SECTION_ENTITY_EXTERNAL_ID_FIELD'))
107 ,
108 (new StringField('GAPI_CALENDAR_ID',
109 [
110 'validation' => [__CLASS__, 'validateGapiCalendarId']
111 ]
112 ))
113 ->configureTitle(Loc::getMessage('SECTION_ENTITY_GAPI_CALENDAR_ID_FIELD'))
114 ,
115 (new BooleanField('ACTIVE'))
116 ->configureTitle(Loc::getMessage('SECTION_ENTITY_ACTIVE_FIELD'))
117 ->configureValues('N', 'Y')
118 ->configureDefaultValue('Y')
119 ,
120 (new TextField('DESCRIPTION'))
121 ->configureTitle(Loc::getMessage('SECTION_ENTITY_DESCRIPTION_FIELD'))
122 ,
123 (new StringField('COLOR',
124 [
125 'validation' => [__CLASS__, 'validateColor']
126 ]
127 ))
128 ->configureTitle(Loc::getMessage('SECTION_ENTITY_COLOR_FIELD'))
129 ,
130 (new StringField('TEXT_COLOR',
131 [
132 'validation' => [__CLASS__, 'validateTextColor']
133 ]
134 ))
135 ->configureTitle(Loc::getMessage('SECTION_ENTITY_TEXT_COLOR_FIELD'))
136 ,
137 (new StringField('EXPORT',
138 [
139 'validation' => [__CLASS__, 'validateExport']
140 ]
141 ))
142 ->configureTitle(Loc::getMessage('SECTION_ENTITY_EXPORT_FIELD'))
143 ,
144 (new IntegerField('SORT'))
145 ->configureTitle(Loc::getMessage('SECTION_ENTITY_SORT_FIELD'))
146 ->configureDefaultValue(100)
147 ,
148 (new StringField('CAL_TYPE',
149 [
150 'validation' => [__CLASS__, 'validateCalType']
151 ]
152 ))
153 ->configureTitle(Loc::getMessage('SECTION_ENTITY_CAL_TYPE_FIELD'))
154 ,
155 (new IntegerField('OWNER_ID'))
156 ->configureTitle(Loc::getMessage('SECTION_ENTITY_OWNER_ID_FIELD'))
157 ,
158 (new IntegerField('CREATED_BY'))
159 ->configureTitle(Loc::getMessage('SECTION_ENTITY_CREATED_BY_FIELD'))
160 ->configureRequired(true)
161 ,
162 (new IntegerField('PARENT_ID'))
163 ->configureTitle(Loc::getMessage('SECTION_ENTITY_PARENT_ID_FIELD'))
164 ,
165 (new DatetimeField('DATE_CREATE'))
166 ->configureTitle(Loc::getMessage('SECTION_ENTITY_DATE_CREATE_FIELD'))
167 ,
168 (new DatetimeField('TIMESTAMP_X'))
169 ->configureTitle(Loc::getMessage('SECTION_ENTITY_TIMESTAMP_X_FIELD'))
170 ,
171 (new StringField('DAV_EXCH_CAL',
172 [
173 'validation' => [__CLASS__, 'validateDavExchCal']
174 ]
175 ))
176 ->configureTitle(Loc::getMessage('SECTION_ENTITY_DAV_EXCH_CAL_FIELD'))
177 ,
178 (new StringField('DAV_EXCH_MOD',
179 [
180 'validation' => [__CLASS__, 'validateDavExchMod']
181 ]
182 ))
183 ->configureTitle(Loc::getMessage('SECTION_ENTITY_DAV_EXCH_MOD_FIELD'))
184 ,
185 (new StringField('CAL_DAV_CON',
186 [
187 'validation' => [__CLASS__, 'validateCalDavCon']
188 ]
189 ))
190 ->configureTitle(Loc::getMessage('SECTION_ENTITY_CAL_DAV_CON_FIELD'))
191 ,
192 (new StringField('CAL_DAV_CAL',
193 [
194 'validation' => [__CLASS__, 'validateCalDavCal']
195 ]
196 ))
197 ->configureTitle(Loc::getMessage('SECTION_ENTITY_CAL_DAV_CAL_FIELD'))
198 ,
199 (new StringField('CAL_DAV_MOD',
200 [
201 'validation' => [__CLASS__, 'validateCalDavMod']
202 ]
203 ))
204 ->configureTitle(Loc::getMessage('SECTION_ENTITY_CAL_DAV_MOD_FIELD'))
205 ,
206 (new StringField('IS_EXCHANGE',
207 [
208 'validation' => [__CLASS__, 'validateIsExchange']
209 ]
210 ))
211 ->configureTitle(Loc::getMessage('SECTION_ENTITY_IS_EXCHANGE_FIELD'))
212 ,
213 (new StringField('SYNC_TOKEN',
214 [
215 'validation' => [__CLASS__, 'validateSyncToken']
216 ]
217 ))
218 ->configureTitle(Loc::getMessage('SECTION_ENTITY_SYNC_TOKEN_FIELD'))
219 ,
220 (new StringField('PAGE_TOKEN',
221 [
222 'validation' => [__CLASS__, 'validatePageToken']
223 ]
224 ))
225 ->configureTitle(Loc::getMessage('SECTION_ENTITY_PAGE_TOKEN_FIELD'))
226 ,
227 (new StringField('EXTERNAL_TYPE',
228 [
229 'validation' => [__CLASS__, 'validateExternalType']
230 ]
231 ))
232 ->configureTitle(Loc::getMessage('SECTION_ENTITY_EXTERNAL_TYPE_FIELD'))
233 ,
234 ];
235 }
236
242 public static function validateName(): array
243 {
244 return [
245 new LengthValidator(null, 255),
246 ];
247 }
248
254 public static function validateXmlId(): array
255 {
256 return [
257 new LengthValidator(null, 100),
258 ];
259 }
260
266 public static function validateExternalId(): array
267 {
268 return [
269 new LengthValidator(null, 100),
270 ];
271 }
272
278 public static function validateGapiCalendarId(): array
279 {
280 return [
281 new LengthValidator(null, 255),
282 ];
283 }
284
290 public static function validateColor(): array
291 {
292 return [
293 new LengthValidator(null, 10),
294 ];
295 }
296
302 public static function validateTextColor(): array
303 {
304 return [
305 new LengthValidator(null, 10),
306 ];
307 }
308
314 public static function validateExport(): array
315 {
316 return [
317 new LengthValidator(null, 255),
318 ];
319 }
320
326 public static function validateCalType(): array
327 {
328 return [
329 new LengthValidator(null, 100),
330 ];
331 }
332
338 public static function validateDavExchCal(): array
339 {
340 return [
341 new LengthValidator(null, 255),
342 ];
343 }
344
350 public static function validateDavExchMod(): array
351 {
352 return [
353 new LengthValidator(null, 255),
354 ];
355 }
356
362 public static function validateCalDavCon(): array
363 {
364 return [
365 new LengthValidator(null, 255),
366 ];
367 }
368
374 public static function validateCalDavCal(): array
375 {
376 return [
377 new LengthValidator(null, 255),
378 ];
379 }
380
386 public static function validateCalDavMod(): array
387 {
388 return [
389 new LengthValidator(null, 255),
390 ];
391 }
392
398 public static function validateIsExchange(): array
399 {
400 return [
401 new LengthValidator(null, 1),
402 ];
403 }
404
410 public static function validateSyncToken(): array
411 {
412 return [
413 new LengthValidator(null, 255),
414 ];
415 }
416
422 public static function validatePageToken(): array
423 {
424 return [
425 new LengthValidator(null, 255),
426 ];
427 }
428
434 public static function validateExternalType(): array
435 {
436 return [
437 new LengthValidator(null, 20),
438 ];
439 }
440}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29