Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
userprops.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';
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 'NAME' => array(
51 'required' => true,
52 'data_type' => 'string',
53 'validation' => array(__CLASS__, 'getNameValidators'),
54 ),
55 'USER_ID' => array(
56 'required' => true,
57 'data_type' => 'integer',
58 'format' => '/^[0-9]{1,11}$/',
59 ),
60 'PERSON_TYPE_ID' => array(
61 'required' => true,
62 'data_type' => 'integer',
63 'format' => '/^[0-9]{1,11}$/',
64 ),
65 'DATE_UPDATE' => array(
66 'data_type' => 'datetime',
67 ),
68 'XML_ID' => array(
69 'data_type' => 'string',
70 'validation' => array(__CLASS__, 'getXmlValidators'),
71 ),
72 'VERSION_1C' => array(
73 'data_type' => 'string',
74 'validation' => array(__CLASS__, 'get1CValidators'),
75 ),
76 );
77 }
78
79 public static function getNameValidators()
80 {
81 return array(
82 new Validator\Length(1, 255),
83 );
84 }
85
86 public static function getXmlValidators()
87 {
88 return array(
89 new Validator\Length(0, 50),
90 );
91 }
92
93 public static function get1CValidators()
94 {
95 return array(
96 new Validator\Length(0, 15),
97 );
98 }
99}