1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
elementtable.php
См. документацию.
1<?php
2namespace Bitrix\Iblock;
3
4use Bitrix\Main\ORM\Fields\Validators;
5use Bitrix\Main;
6use Bitrix\Main\ORM;
7use Bitrix\Main\Localization\Loc;
8
72
74{
75 public const TYPE_TEXT = 'text';
76 public const TYPE_HTML = 'html';
77
83 public static function getTableName(): string
84 {
85 return 'b_iblock_element';
86 }
87
93 public static function getMap(): array
94 {
95 return [
96 'ID' => new ORM\Fields\IntegerField(
97 'ID',
98 [
99 'primary' => true,
100 'autocomplete' => true,
101 'title' => Loc::getMessage('ELEMENT_ENTITY_ID_FIELD'),
102 ]
103 ),
104 'TIMESTAMP_X' => new ORM\Fields\DatetimeField(
105 'TIMESTAMP_X',
106 [
107 'default_value' => function()
108 {
109 return new Main\Type\DateTime();
110 },
111 'title' => Loc::getMessage('ELEMENT_ENTITY_TIMESTAMP_X_FIELD'),
112 ]
113 ),
114 'MODIFIED_BY' => new ORM\Fields\IntegerField(
115 'MODIFIED_BY',
116 [
117 'title' => Loc::getMessage('ELEMENT_ENTITY_MODIFIED_BY_FIELD'),
118 ]
119 ),
120 'DATE_CREATE' => new ORM\Fields\DatetimeField(
121 'DATE_CREATE',
122 [
123 'default_value' => function()
124 {
125 return new Main\Type\DateTime();
126 },
127 'title' => Loc::getMessage('ELEMENT_ENTITY_DATE_CREATE_FIELD'),
128 ]
129 ),
130 'CREATED_BY' => new ORM\Fields\IntegerField(
131 'CREATED_BY',
132 [
133 'title' => Loc::getMessage('ELEMENT_ENTITY_CREATED_BY_FIELD'),
134 ]
135 ),
136 'IBLOCK_ID' => new ORM\Fields\IntegerField(
137 'IBLOCK_ID',
138 [
139 'required' => true,
140 'title' => Loc::getMessage('ELEMENT_ENTITY_IBLOCK_ID_FIELD'),
141 ]
142 ),
143 'IBLOCK_SECTION_ID' => new ORM\Fields\IntegerField(
144 'IBLOCK_SECTION_ID',
145 [
146 'title' => Loc::getMessage('ELEMENT_ENTITY_IBLOCK_SECTION_ID_FIELD'),
147 ]
148 ),
149 'ACTIVE' => new ORM\Fields\BooleanField(
150 'ACTIVE',
151 [
152 'values' => ['N', 'Y'],
153 'default_value' => 'Y',
154 'title' => Loc::getMessage('ELEMENT_ENTITY_ACTIVE_FIELD'),
155 ]
156 ),
157 'ACTIVE_FROM' => new ORM\Fields\DatetimeField(
158 'ACTIVE_FROM',
159 [
160 'title' => Loc::getMessage('ELEMENT_ENTITY_ACTIVE_FROM_FIELD'),
161 ]
162 ),
163 'ACTIVE_TO' => new ORM\Fields\DatetimeField(
164 'ACTIVE_TO',
165 [
166 'title' => Loc::getMessage('ELEMENT_ENTITY_ACTIVE_TO_FIELD'),
167 ]
168 ),
169 'SORT' => new ORM\Fields\IntegerField(
170 'SORT',
171 [
172 'default_value' => 500,
173 'title' => Loc::getMessage('ELEMENT_ENTITY_SORT_FIELD'),
174 ]
175 ),
176 'NAME' => new ORM\Fields\StringField(
177 'NAME',
178 [
179 'required' => true,
180 'validation' => function()
181 {
182 return [
183 new Validators\LengthValidator(null, 255),
184 ];
185 },
186 'title' => Loc::getMessage('ELEMENT_ENTITY_NAME_FIELD'),
187 ]
188 ),
189 'PREVIEW_PICTURE' => new ORM\Fields\IntegerField(
190 'PREVIEW_PICTURE',
191 [
192 'title' => Loc::getMessage('ELEMENT_ENTITY_PREVIEW_PICTURE_FIELD'),
193 ]
194 ),
195 'PREVIEW_TEXT' => new ORM\Fields\TextField(
196 'PREVIEW_TEXT',
197 [
198 'title' => Loc::getMessage('ELEMENT_ENTITY_PREVIEW_TEXT_FIELD'),
199 ]
200 ),
201 'PREVIEW_TEXT_TYPE' => new ORM\Fields\EnumField(
202 'PREVIEW_TEXT_TYPE',
203 [
204 'values' => [
205 self::TYPE_TEXT,
206 self::TYPE_HTML,
207 ],
208 'default_value' => self::TYPE_TEXT,
209 'title' => Loc::getMessage('ELEMENT_ENTITY_PREVIEW_TEXT_TYPE_FIELD'),
210 ]
211 ),
212 'DETAIL_PICTURE' => new ORM\Fields\IntegerField(
213 'DETAIL_PICTURE',
214 [
215 'title' => Loc::getMessage('ELEMENT_ENTITY_DETAIL_PICTURE_FIELD'),
216 ]
217 ),
218 'DETAIL_TEXT' => new ORM\Fields\TextField(
219 'DETAIL_TEXT',
220 [
221 'title' => Loc::getMessage('ELEMENT_ENTITY_DETAIL_TEXT_FIELD'),
222 ]
223 ),
224 'DETAIL_TEXT_TYPE' => new ORM\Fields\EnumField(
225 'DETAIL_TEXT_TYPE',
226 [
227 'values' => [
228 self::TYPE_TEXT,
229 self::TYPE_HTML,
230 ],
231 'default_value' => self::TYPE_TEXT,
232 'title' => Loc::getMessage('ELEMENT_ENTITY_DETAIL_TEXT_TYPE_FIELD'),
233 ]
234 ),
235 'SEARCHABLE_CONTENT' => new ORM\Fields\TextField(
236 'SEARCHABLE_CONTENT',
237 [
238 'title' => Loc::getMessage('ELEMENT_ENTITY_SEARCHABLE_CONTENT_FIELD'),
239 ]
240 ),
241 'WF_STATUS_ID' => new ORM\Fields\IntegerField(
242 'WF_STATUS_ID',
243 [
244 'title' => Loc::getMessage('ELEMENT_ENTITY_WF_STATUS_ID_FIELD'),
245 ]
246 ),
247 'WF_PARENT_ELEMENT_ID' => new ORM\Fields\IntegerField(
248 'WF_PARENT_ELEMENT_ID',
249 [
250 'title' => Loc::getMessage('ELEMENT_ENTITY_WF_PARENT_ELEMENT_ID_FIELD'),
251 ]
252 ),
253 'WF_NEW' => new ORM\Fields\EnumField(
254 'WF_NEW',
255 [
256 'values' => [
257 'N',
258 'Y',
259 ],
260 'title' => Loc::getMessage('ELEMENT_ENTITY_WF_NEW_FIELD'),
261 ]
262 ),
263 'WF_LOCKED_BY' => new ORM\Fields\IntegerField(
264 'WF_LOCKED_BY',
265 [
266 'title' => Loc::getMessage('ELEMENT_ENTITY_WF_LOCKED_BY_FIELD'),
267 ]
268 ),
269 'WF_DATE_LOCK' => new ORM\Fields\DatetimeField(
270 'WF_DATE_LOCK',
271 [
272 'title' => Loc::getMessage('ELEMENT_ENTITY_WF_DATE_LOCK_FIELD'),
273 ]
274 ),
275 'WF_COMMENTS' => new ORM\Fields\TextField(
276 'WF_COMMENTS',
277 [
278 'title' => Loc::getMessage('ELEMENT_ENTITY_WF_COMMENTS_FIELD'),
279 ]
280 ),
281 'IN_SECTIONS' => new ORM\Fields\BooleanField(
282 'IN_SECTIONS',
283 [
284 'values' => ['N', 'Y'],
285 'title' => Loc::getMessage('ELEMENT_ENTITY_IN_SECTIONS_FIELD'),
286 ]
287 ),
288 'XML_ID' => new ORM\Fields\StringField(
289 'XML_ID',
290 [
291 'validation' => function()
292 {
293 return [
294 new Validators\LengthValidator(null, 255),
295 ];
296 },
297 'title' => Loc::getMessage('ELEMENT_ENTITY_XML_ID_FIELD'),
298 ]
299 ),
300 'CODE' => new ORM\Fields\StringField(
301 'CODE',
302 [
303 'validation' => function()
304 {
305 return [
306 new Validators\LengthValidator(null, 255),
307 ];
308 },
309 'title' => Loc::getMessage('ELEMENT_ENTITY_CODE_FIELD'),
310 ]
311 ),
312 'TAGS' => new ORM\Fields\StringField(
313 'TAGS',
314 [
315 'validation' => function()
316 {
317 return [
318 new Validators\LengthValidator(null, 255),
319 ];
320 },
321 'title' => Loc::getMessage('ELEMENT_ENTITY_TAGS_FIELD'),
322 ]
323 ),
324 'TMP_ID' => new ORM\Fields\StringField(
325 'TMP_ID',
326 [
327 'validation' => function()
328 {
329 return [
330 new Validators\LengthValidator(null, 40),
331 ];
332 },
333 'title' => Loc::getMessage('ELEMENT_ENTITY_TMP_ID_FIELD'),
334 ]
335 ),
336 'SHOW_COUNTER' => new ORM\Fields\IntegerField(
337 'SHOW_COUNTER',
338 [
339 'default_value' => 0,
340 'title' => Loc::getMessage('ELEMENT_ENTITY_SHOW_COUNTER_FIELD'),
341 ]
342 ),
343 'SHOW_COUNTER_START' => new ORM\Fields\DatetimeField(
344 'SHOW_COUNTER_START',
345 [
346 'title' => Loc::getMessage('ELEMENT_ENTITY_SHOW_COUNTER_START_FIELD'),
347 ]
348 ),
349 'IBLOCK' => new ORM\Fields\Relations\Reference(
350 'IBLOCK',
351 '\Bitrix\Iblock\Iblock',
352 ['=this.IBLOCK_ID' => 'ref.ID'],
353 ['join_type' => 'LEFT'],
354 ),
355 'WF_PARENT_ELEMENT' => new ORM\Fields\Relations\Reference(
356 'WF_PARENT_ELEMENT',
357 '\Bitrix\Iblock\Element',
358 ['=this.WF_PARENT_ELEMENT_ID' => 'ref.ID'],
359 ['join_type' => 'LEFT'],
360 ),
361 'IBLOCK_SECTION' => new ORM\Fields\Relations\Reference(
362 'IBLOCK_SECTION',
363 '\Bitrix\Iblock\Section',
364 ['=this.IBLOCK_SECTION_ID' => 'ref.ID'],
365 ['join_type' => 'LEFT'],
366 ),
367 'MODIFIED_BY_USER' => new ORM\Fields\Relations\Reference(
368 'MODIFIED_BY_USER',
369 '\Bitrix\Main\User',
370 ['=this.MODIFIED_BY' => 'ref.ID'],
371 ['join_type' => 'LEFT'],
372 ),
373 'CREATED_BY_USER' => new ORM\Fields\Relations\Reference(
374 'CREATED_BY_USER',
375 '\Bitrix\Main\User',
376 ['=this.CREATED_BY' => 'ref.ID'],
377 ['join_type' => 'LEFT'],
378 ),
379 'WF_LOCKED_BY_USER' => new ORM\Fields\Relations\Reference(
380 'WF_LOCKED_BY_USER',
381 '\Bitrix\Main\User',
382 ['=this.WF_LOCKED_BY' => 'ref.ID'],
383 ['join_type' => 'LEFT'],
384 ),
385 ];
386 }
387
394 public static function add(array $data): ORM\Data\AddResult
395 {
397 $result->addError(new ORM\EntityError(
398 Loc::getMessage('ELEMENT_ENTITY_MESS_ADD_BLOCKED')
399 ));
400
401 return $result;
402 }
403
411 public static function update($primary, array $data): ORM\Data\UpdateResult
412 {
414 $result->addError(new ORM\EntityError(
415 Loc::getMessage('ELEMENT_ENTITY_MESS_UPDATE_BLOCKED')
416 ));
417
418 return $result;
419 }
420
427 public static function delete($primary): ORM\Data\DeleteResult
428 {
430 $result->addError(new ORM\EntityError(
431 Loc::getMessage('ELEMENT_ENTITY_MESS_DELETE_BLOCKED')
432 ));
433
434 return $result;
435 }
436}
static getMap()
Определения elementtable.php:93
static add(array $data)
Определения elementtable.php:394
const TYPE_HTML
Определения elementtable.php:76
const TYPE_TEXT
Определения elementtable.php:75
static update($primary, array $data)
Определения elementtable.php:411
static getTableName()
Определения elementtable.php:83
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
Определения aliases.php:105