Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
section.php
1<?php
2
3
5
6
12
13final class Section extends Base
14{
15
16 public function getFields()
17 {
18 return [
19 'ID'=>[
20 'TYPE'=>DataType::TYPE_INT,
21 'ATTRIBUTES'=>[
22 Attributes::READONLY
23 ]
24 ],
25 'DESCRIPTION'=>[
26 'TYPE'=>DataType::TYPE_STRING
27 ],
28 'DESCRIPTION_TYPE'=>[
29 'TYPE'=>DataType::TYPE_STRING
30 ],
31 'IBLOCK_SECTION_ID'=>[
32 'TYPE'=>DataType::TYPE_INT
33 ],
34 'IBLOCK_ID'=>[
35 'TYPE'=>DataType::TYPE_INT,
36 'ATTRIBUTES'=>[
37 Attributes::REQUIRED
38 ]
39 ],
40 'ACTIVE'=>[
41 'TYPE'=>DataType::TYPE_CHAR
42 ],
43 'CODE'=>[
44 'TYPE'=>DataType::TYPE_STRING
45 ],
46 'XML_ID'=>[
47 'TYPE'=>DataType::TYPE_STRING
48 ],
49 'SORT'=>[
50 'TYPE'=>DataType::TYPE_INT
51 ],
52 'NAME'=>[
53 'TYPE'=>DataType::TYPE_STRING,
54 'ATTRIBUTES'=>[
55 Attributes::REQUIRED
56 ]
57 ],
58 ];
59 }
60
61 public function checkFieldsList($arguments): Result
62 {
63 $r = new Result();
64
65 $error=[];
66
67 if(count($error)>0)
68 $r->addError(new Error('Required select fields: '.implode(', ', $error)));
69
70 if(!isset($arguments['filter']['IBLOCK_ID']))
71 $r->addError(new Error('Required filter fields: iblockId'));
72
73 return $r;
74 }
75}