Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
userpropsvalue.php
1<?php
9
10use Bitrix\Main\Entity\DataManager,
11 Bitrix\Main\Entity\Validator;
12
30{
31 public static function getFilePath()
32 {
33 return __FILE__;
34 }
35
36 public static function getTableName()
37 {
38 return 'b_sale_user_props_value';
39 }
40
41 public static function getMap()
42 {
43 return array(
44 'ID' => array(
45 'primary' => true,
46 'autocomplete' => true,
47 'data_type' => 'integer',
48 'format' => '/^[0-9]{1,11}$/',
49 ),
50 'USER_PROPS_ID' => array(
51 'data_type' => 'integer',
52 'format' => '/^[0-9]{1,11}$/',
53 ),
54 'ORDER_PROPS_ID' => array(
55 'data_type' => 'integer',
56 'format' => '/^[0-9]{1,11}$/',
57 ),
58 'NAME' => array(
59 'required' => true,
60 'data_type' => 'string',
61 'validation' => array(__CLASS__, 'getNameValidators'),
62 ),
63 'VALUE' => array(
64 'data_type' => 'string',
65 'validation' => array(__CLASS__, 'getValueValidators'),
66 ),
67
68 'PROPERTY' => array(
69 'data_type' => 'Bitrix\Sale\Internals\OrderPropsTable',
70 'reference' => array('=this.ORDER_PROPS_ID' => 'ref.ID'),
71 'join_type' => 'LEFT',
72 ),
73 'USER_PROPERTY' => array(
74 'data_type' => 'Bitrix\Sale\Internals\UserPropsTable',
75 'reference' => array('=this.USER_PROPS_ID' => 'ref.ID'),
76 'join_type' => 'LEFT',
77 ),
78 );
79 }
80
81 public static function getNameValidators()
82 {
83 return array(
84 new Validator\Length(1, 255),
85 );
86 }
87
88 public static function getValueValidators()
89 {
90 return array(
91 new Validator\Length(null, 255),
92 );
93 }
94}