Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
typetable.php
1<?php
2
4
11
39class TypeTable extends Main\Entity\DataManager
40{
46 public static function getTableName()
47 {
48 return 'b_calendar_type';
49 }
50
56 public static function getMap()
57 {
58 return [
59 (new StringField('XML_ID',
60 [
61 'validation' => [__CLASS__, 'validateXmlId']
62 ]
63 ))
64 ->configureTitle(Loc::getMessage('TYPE_ENTITY_XML_ID_FIELD'))
65 ->configurePrimary(true)
66 ,
67 (new StringField('NAME',
68 [
69 'validation' => [__CLASS__, 'validateName']
70 ]
71 ))
72 ->configureTitle(Loc::getMessage('TYPE_ENTITY_NAME_FIELD'))
73 ,
74 (new TextField('DESCRIPTION'))
75 ->configureTitle(Loc::getMessage('TYPE_ENTITY_DESCRIPTION_FIELD'))
76 ,
77 (new StringField('EXTERNAL_ID',
78 [
79 'validation' => [__CLASS__, 'validateExternalId']
80 ]
81 ))
82 ->configureTitle(Loc::getMessage('TYPE_ENTITY_EXTERNAL_ID_FIELD'))
83 ,
84 (new BooleanField('ACTIVE'))
85 ->configureTitle(Loc::getMessage('TYPE_ENTITY_ACTIVE_FIELD'))
86 ->configureValues('N', 'Y')
87 ->configureDefaultValue('Y')
88 ,
89 ];
90 }
91
97 public static function validateXmlId(): array
98 {
99 return [
100 new LengthValidator(null, 255),
101 ];
102 }
103
109 public static function validateName(): array
110 {
111 return [
112 new LengthValidator(null, 255),
113 ];
114 }
115
121 public static function validateExternalId(): array
122 {
123 return [
124 new LengthValidator(null, 100),
125 ];
126 }
127}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29