Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
request.php
1<?
3
8
9Loc::loadMessages(__FILE__);
10
39class RequestTable extends Entity\DataManager
40{
46 public static function getTableName()
47 {
48 return 'b_sale_delivery_req';
49 }
50
56 public static function getMap()
57 {
58 return array(
59 'ID' => array(
60 'data_type' => 'integer',
61 'primary' => true,
62 'autocomplete' => true,
63 'title' => Loc::getMessage('SALE_DLVR_REQ_TBL_ID_FIELD'),
64 ),
65 'DATE' => array(
66 'data_type' => 'datetime',
67 'title' => Loc::getMessage('SALE_DLVR_REQ_TBL_DATE_INSERT_FIELD'),
68 ),
69 'DELIVERY_ID' => array(
70 'data_type' => 'integer',
71 'required' => true,
72 'title' => Loc::getMessage('SALE_DLVR_REQ_TBL_DELIVERY_ID_FIELD'),
73 ),
74 'STATUS' => array(
75 'data_type' => 'integer',
76 'title' => Loc::getMessage('SALE_DLVR_REQ_TBL_STATUS_FIELD'),
77 ),
78 'CREATED_BY' => array(
79 'data_type' => 'integer',
80 ),
81 'EXTERNAL_ID' => array(
82 'data_type' => 'string',
83 'required' => true,
84 'validation' => array(__CLASS__, 'validateExternalId'),
85 'title' => Loc::getMessage('SALE_DLVR_REQ_TBL_EXTERNAL_ID_FIELD'),
86 ),
87 'EXTERNAL_STATUS' => array(
88 'data_type' => 'string',
89 'validation' => array(__CLASS__, 'validateExternalStatus'),
90 ),
91 'EXTERNAL_STATUS_SEMANTIC' => array(
92 'data_type' => 'string',
93 'validation' => array(__CLASS__, 'validateExternalStatusSemantic'),
94 ),
95 'DELIVERY' => array(
96 'data_type' => '\Bitrix\Sale\Delivery\Services\Table',
97 'reference' => array('=this.DELIVERY_ID' => 'ref.ID'),
98 ),
99 (new ArrayField('EXTERNAL_PROPERTIES'))
100 ->configureSerializationPhp()
101 ->configureUnserializeCallback(function ($value) {
102 return unserialize(
103 $value,
104 ['allowed_classes' => false]
105 );
106 }),
107 (new OneToMany('SHIPMENTS', ShipmentTable::class, 'REQUEST'))
108 ->configureJoinType('inner'),
109 );
110 }
111
117 public static function validateExternalId()
118 {
119 return array(
120 new Entity\Validator\Length(null, 100),
121 );
122 }
123
127 public static function validateExternalStatus()
128 {
129 return [
130 new Entity\Validator\Length(null, 255),
131 ];
132 }
133
137 public static function validateExternalStatusSemantic()
138 {
139 return [
140 new Entity\Validator\Length(null, 50),
141 ];
142 }
143}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29