Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
resource.php
1<?php
3
6Loc::loadMessages(__FILE__);
7
51class ResourceTable extends Main\Entity\DataManager
52{
58 public static function getTableName()
59 {
60 return 'b_calendar_resource';
61 }
62
68 public static function getMap()
69 {
70 return array(
71 'ID' => array(
72 'data_type' => 'integer',
73 'primary' => true,
74 'autocomplete' => true,
75 'title' => Loc::getMessage('RESOURCE_ENTITY_ID_FIELD'),
76 ),
77 'EVENT_ID' => array(
78 'data_type' => 'integer',
79 'title' => Loc::getMessage('RESOURCE_ENTITY_EVENT_ID_FIELD'),
80 ),
81 'CAL_TYPE' => array(
82 'data_type' => 'string',
83 'validation' => array(__CLASS__, 'validateCalType'),
84 'title' => Loc::getMessage('RESOURCE_ENTITY_CAL_TYPE_FIELD'),
85 ),
86 'RESOURCE_ID' => array(
87 'data_type' => 'integer',
88 'required' => true,
89 'title' => Loc::getMessage('RESOURCE_ENTITY_RESOURCE_ID_FIELD'),
90 ),
91 'PARENT_TYPE' => array(
92 'data_type' => 'string',
93 'validation' => array(__CLASS__, 'validateParentType'),
94 'title' => Loc::getMessage('RESOURCE_ENTITY_PARENT_TYPE_FIELD'),
95 ),
96 'PARENT_ID' => array(
97 'data_type' => 'integer',
98 'required' => true,
99 'title' => Loc::getMessage('RESOURCE_ENTITY_PARENT_ID_FIELD'),
100 ),
101 'UF_ID' => array(
102 'data_type' => 'integer',
103 'required' => false,
104 'title' => Loc::getMessage('RESOURCE_ENTITY_UF_ID_FIELD'),
105 ),
106 'DATE_FROM_UTC' => array(
107 'data_type' => 'datetime',
108 'title' => Loc::getMessage('RESOURCE_ENTITY_DATE_FROM_UTC_FIELD'),
109 ),
110 'DATE_TO_UTC' => array(
111 'data_type' => 'datetime',
112 'title' => Loc::getMessage('RESOURCE_ENTITY_DATE_TO_UTC_FIELD'),
113 ),
114 'DATE_FROM' => array(
115 'data_type' => 'datetime',
116 'title' => Loc::getMessage('RESOURCE_ENTITY_DATE_FROM_FIELD'),
117 ),
118 'DATE_TO' => array(
119 'data_type' => 'datetime',
120 'title' => Loc::getMessage('RESOURCE_ENTITY_DATE_TO_FIELD'),
121 ),
122 'DURATION' => array(
123 'data_type' => 'integer',
124 'title' => Loc::getMessage('RESOURCE_ENTITY_DURATION_FIELD'),
125 ),
126 'SKIP_TIME' => array(
127 'data_type' => 'string',
128 'validation' => array(__CLASS__, 'validateSkipTime'),
129 'title' => Loc::getMessage('RESOURCE_ENTITY_SKIP_TIME_FIELD'),
130 ),
131 'TZ_FROM' => array(
132 'data_type' => 'string',
133 'validation' => array(__CLASS__, 'validateTzFrom'),
134 'title' => Loc::getMessage('RESOURCE_ENTITY_TZ_FROM_FIELD'),
135 ),
136 'TZ_TO' => array(
137 'data_type' => 'string',
138 'validation' => array(__CLASS__, 'validateTzTo'),
139 'title' => Loc::getMessage('RESOURCE_ENTITY_TZ_TO_FIELD'),
140 ),
141 'TZ_OFFSET_FROM' => array(
142 'data_type' => 'integer',
143 'title' => Loc::getMessage('RESOURCE_ENTITY_TZ_OFFSET_FROM_FIELD'),
144 ),
145 'TZ_OFFSET_TO' => array(
146 'data_type' => 'integer',
147 'title' => Loc::getMessage('RESOURCE_ENTITY_TZ_OFFSET_TO_FIELD'),
148 ),
149 'CREATED_BY' => array(
150 'data_type' => 'integer',
151 'required' => true,
152 'title' => Loc::getMessage('RESOURCE_ENTITY_CREATED_BY_FIELD'),
153 ),
154 'DATE_CREATE' => array(
155 'data_type' => 'datetime',
156 'title' => Loc::getMessage('RESOURCE_ENTITY_DATE_CREATE_FIELD'),
157 ),
158 'TIMESTAMP_X' => array(
159 'data_type' => 'datetime',
160 'title' => Loc::getMessage('RESOURCE_ENTITY_TIMESTAMP_X_FIELD'),
161 ),
162 'SERVICE_NAME' => array(
163 'data_type' => 'string',
164 'validation' => array(__CLASS__, 'validateServiceName'),
165 'title' => Loc::getMessage('RESOURCE_ENTITY_SERVICE_NAME_FIELD'),
166 ),
167 );
168 }
174 public static function validateCalType()
175 {
176 return array(
177 new Main\Entity\Validator\Length(null, 100),
178 );
179 }
185 public static function validateParentType()
186 {
187 return array(
188 new Main\Entity\Validator\Length(null, 100),
189 );
190 }
196 public static function validateSkipTime()
197 {
198 return array(
199 new Main\Entity\Validator\Length(null, 1),
200 );
201 }
207 public static function validateTzFrom()
208 {
209 return array(
210 new Main\Entity\Validator\Length(null, 50),
211 );
212 }
218 public static function validateTzTo()
219 {
220 return array(
221 new Main\Entity\Validator\Length(null, 50),
222 );
223 }
229 public static function validateServiceName()
230 {
231 return array(
232 new Main\Entity\Validator\Length(null, 200),
233 );
234 }
235}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29