Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
orderprops_value.php
1<?php
9
10use Bitrix\Main\Entity\DataManager,
11 Bitrix\Main\Entity\Validator;
14
32{
33 public static function getFilePath()
34 {
35 return __FILE__;
36 }
37
38 public static function getTableName()
39 {
40 return 'b_sale_order_props_value';
41 }
42
43 public static function getMap()
44 {
45 return array(
46 'ID' => array(
47 'primary' => true,
48 'autocomplete' => true,
49 'data_type' => 'integer',
50 'format' => '/^[0-9]{1,11}$/',
51 ),
52 'ORDER_ID' => array(
53 'data_type' => 'integer',
54 'format' => '/^[0-9]{1,11}$/',
55 ),
56 'ORDER_PROPS_ID' => array(
57 'data_type' => 'integer',
58 'format' => '/^[0-9]{1,11}$/',
59 ),
60 'NAME' => array(
61 'required' => true,
62 'data_type' => 'string',
63 'validation' => array(__CLASS__, 'getNameValidators'),
64 ),
65 'VALUE' => array(
66 'data_type' => 'string',
67 'validation' => array('Bitrix\Sale\Internals\OrderPropsTable', 'getValueValidators'),
68 'save_data_modification' => array('Bitrix\Sale\Internals\OrderPropsTable', 'getValueSaveModifiers'),
69 'fetch_data_modification' => array('Bitrix\Sale\Internals\OrderPropsTable', 'getValueFetchModifiers'),
70 ),
71 'CODE' => array(
72 'data_type' => 'string',
73 'validation' => array(__CLASS__, 'getCodeValidators'),
74 ),
75
76 'PROPERTY' => array(
77 'data_type' => 'Bitrix\Sale\Internals\OrderPropsTable',
78 'reference' => array('=this.ORDER_PROPS_ID' => 'ref.ID'),
79 'join_type' => 'LEFT',
80 ),
81 'XML_ID' => array(
82 'data_type' => 'string',
83 ),
84 'ENTITY_ID' => array(
85 'data_type' => 'integer',
86 'format' => '/^[0-9]{1,11}$/',
87 ),
88 'ENTITY_TYPE' => array(
89 'data_type' => 'enum',
90 'required' => true,
91 'validation' => array(__CLASS__, 'validateEntityType'),
92 'values' => static::getEntityTypes()
93 ),
94 );
95 }
96
97 public static function getEntityTypes()
98 {
99 return [
102 ];
103 }
104
105 public static function validateEntityType()
106 {
107 return [
108 new EnumValidator(),
109 ];
110 }
111
112 public static function getNameValidators()
113 {
114 return array(
115 new Validator\Length(1, 255),
116 );
117 }
118
119 public static function getCodeValidators()
120 {
121 return array(
122 new Validator\Length(null, 50),
123 );
124 }
125}