Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
persontype.php
1<?php
9
10use Bitrix\Main;
12
13Loc::loadMessages(__FILE__);
14
43class PersonTypeTable extends Main\Entity\DataManager
44{
50 public static function getFilePath()
51 {
52 return __FILE__;
53 }
54
60 public static function getTableName()
61 {
62 return 'b_sale_person_type';
63 }
64
70 public static function getMap()
71 {
72 return array(
73 'ID' => array(
74 'data_type' => 'integer',
75 'primary' => true,
76 'autocomplete' => true,
77 ),
78 'LID' => array(
79 'data_type' => 'string',
80 'required' => true,
81 'validation' => array(__CLASS__, 'validateLid'),
82 ),
83 new Main\Entity\ReferenceField(
84 'PERSON_TYPE_SITE',
85 '\Bitrix\Sale\Internals\PersonTypeSiteTable',
86 array('=this.ID' => 'ref.PERSON_TYPE_ID'),
87 array('join_type' => 'LEFT')
88 ),
89 'NAME' => array(
90 'data_type' => 'string',
91 'required' => true,
92 'validation' => array(__CLASS__, 'validateName'),
93 ),
94 'CODE' => array(
95 'data_type' => 'string',
96 ),
97 'SORT' => array(
98 'data_type' => 'integer'
99 ),
100 'ACTIVE' => array(
101 'data_type' => 'boolean',
102 'values' => array('N','Y')
103 ),
104 'XML_ID' => array(
105 'data_type' => 'string',
106 ),
107 'ENTITY_REGISTRY_TYPE' => array(
108 'data_type' => 'string',
109 ),
110 );
111 }
112
118 public static function validateLid()
119 {
120 return array(
121 new Main\Entity\Validator\Length(null, 2),
122 );
123 }
129 public static function validateName()
130 {
131 return array(
132 new Main\Entity\Validator\Length(null, 255),
133 );
134 }
135}
static loadMessages($file)
Definition loc.php:64