Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
enum.php
1<?php
2
4
9
10final class Enum extends Controller
11{
13 public const PROPERTY_USER_TYPE_DATETIME = PropertyTable::USER_TYPE_DATETIME;
14 public const PROPERTY_USER_TYPE_MONEY = 'Money';
16 public const PROPERTY_USER_TYPE_SKU = PropertyTable::USER_TYPE_SKU;
17 public const PROPERTY_USER_TYPE_BOOL_ENUM = 'BoolEnum';
18
19 public function getProductTypesAction(): array
20 {
21 $r = [];
23
24 foreach($list as $id=>$name)
25 {
26 $r[] = ['ID'=>$id, 'NAME'=>$name];
27 }
28
29 return ['ENUM'=>$r];
30 }
31
32 public function getRoundTypesAction(): array
33 {
34 $r = [];
35 $list = RoundingTable::getRoundTypes(true);
36
37 foreach($list as $id=>$name)
38 {
39 $r[] = ['ID'=>$id, 'NAME'=>$name];
40 }
41
42 return ['ENUM'=>$r];
43 }
44
48 public function getStoreDocumentTypesAction(): array
49 {
50 $result = [];
51 foreach (Document::getAvailableRestDocumentTypes() as $id=>$name)
52 {
53 $result[] = [
54 'ID' => $id,
55 'NAME' => $name,
56 ];
57 }
58
59 return ['ENUM' => $result];
60 }
61
62 public function getProductPropertyTypesAction(): array
63 {
64 return [
66 ];
67 }
68
69 public static function getProductPropertyTypes(): array
70 {
71 return [
72 'NUMBER' => [
73 'PROPERTY_TYPE' => PropertyTable::TYPE_NUMBER,
74 'USER_TYPE' => null,
75 ],
76 'STRING' => [
77 'PROPERTY_TYPE' => PropertyTable::TYPE_STRING,
78 'USER_TYPE' => null,
79 ],
80 'LIST' => [
81 'PROPERTY_TYPE' => PropertyTable::TYPE_LIST,
82 'USER_TYPE' => null,
83 ],
84 'BOOL_ENUM' => [
85 'PROPERTY_TYPE' => PropertyTable::TYPE_LIST,
87 ],
88 'DATETIME' => [
89 'PROPERTY_TYPE' => PropertyTable::TYPE_STRING,
90 'USER_TYPE' => PropertyTable::USER_TYPE_DATETIME,
91 ],
92 'MONEY' => [
93 'PROPERTY_TYPE' => PropertyTable::TYPE_STRING,
94 'USER_TYPE' => self::PROPERTY_USER_TYPE_MONEY,
95 ],
96 'SKU' => [
97 'PROPERTY_TYPE' => PropertyTable::TYPE_ELEMENT,
98 'USER_TYPE' => PropertyTable::USER_TYPE_SKU,
99 ],
100 ];
101 }
102
103 protected function checkPermissionEntity($name, $arguments=[])
104 {
105 return new Result();
106 }
107}
checkPermissionEntity($name, $arguments=[])
Definition enum.php:103
static getProductTypes($descr=false)
Definition product.php:824
static getRoundTypes(bool $full=false)
Definition rounding.php:443