Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
pushtable.php
1<?php
3
13
14Loc::loadMessages(__FILE__);
15
46class PushTable extends Main\Entity\DataManager
47{
53 public static function getTableName()
54 {
55 return 'b_calendar_push';
56 }
57
63 public static function getMap()
64 {
65 return [
66 (new StringField('ENTITY_TYPE',
67 [
68 'validation' => [__CLASS__, 'validateEntityType']
69 ]
70 ))
71 ->configureTitle(Loc::getMessage('PUSH_ENTITY_ENTITY_TYPE_FIELD'))
72 ->configurePrimary(true)
73 ,
74 (new IntegerField('ENTITY_ID'))
75 ->configureTitle(Loc::getMessage('PUSH_ENTITY_ENTITY_ID_FIELD'))
76 ->configurePrimary(true)
77 ,
78 (new StringField('CHANNEL_ID',
79 [
80 'validation' => [__CLASS__, 'validateChannelId']
81 ]
82 ))
83 ->configureTitle(Loc::getMessage('PUSH_ENTITY_CHANNEL_ID_FIELD'))
84 ->configureRequired(true)
85 ,
86 (new StringField('RESOURCE_ID',
87 [
88 'validation' => [__CLASS__, 'validateResourceId']
89 ]
90 ))
91 ->configureTitle(Loc::getMessage('PUSH_ENTITY_RESOURCE_ID_FIELD'))
92 ->configureRequired(true)
93 ,
94 (new DatetimeField('EXPIRES'))
95 ->configureTitle(Loc::getMessage('PUSH_ENTITY_EXPIRES_FIELD'))
96 ->configureRequired(true)
97 ,
98 (new EnumField('NOT_PROCESSED'))
99 ->configureTitle(Loc::getMessage('PUSH_ENTITY_NOT_PROCESSED_FIELD'))
100 ->configureValues(['N', 'Y', 'B', 'U'])
101 ->configureDefaultValue('N')
102 ,
103 (new DatetimeField('FIRST_PUSH_DATE'))
104 ->configureTitle(Loc::getMessage('PUSH_ENTITY_FIRST_PUSH_DATE_FIELD'))
105 ,
106 ];
107 }
108
114 public static function validateEntityType(): array
115 {
116 return [
117 new LengthValidator(null, 24),
118 ];
119 }
120
126 public static function validateChannelId(): array
127 {
128 return [
129 new LengthValidator(null, 128),
130 ];
131 }
132
138 public static function validateResourceId(): array
139 {
140 return [
141 new LengthValidator(null, 128),
142 ];
143 }
144}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29