Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
request.php
1
<?
2
namespace
Bitrix\Sale\Delivery\Requests
;
3
4
use
Bitrix\Main\Entity
;
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\ORM\Fields\ArrayField
;
7
use
Bitrix\Main\ORM\Fields\Relations\OneToMany
;
8
9
Loc::loadMessages
(__FILE__);
10
39
class
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
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\ORM\Fields\ArrayField
Definition
arrayfield.php:19
Bitrix\Main\ORM\Fields\Relations\OneToMany
Definition
onetomany.php:23
Bitrix\Sale\Delivery\Requests\RequestTable
Definition
request.php:40
Bitrix\Sale\Delivery\Requests\RequestTable\getMap
static getMap()
Definition
request.php:56
Bitrix\Sale\Delivery\Requests\RequestTable\validateExternalId
static validateExternalId()
Definition
request.php:117
Bitrix\Sale\Delivery\Requests\RequestTable\validateExternalStatusSemantic
static validateExternalStatusSemantic()
Definition
request.php:137
Bitrix\Sale\Delivery\Requests\RequestTable\validateExternalStatus
static validateExternalStatus()
Definition
request.php:127
Bitrix\Sale\Delivery\Requests\RequestTable\getTableName
static getTableName()
Definition
request.php:46
Bitrix\Sale\Delivery\Requests
Definition
handlerbase.php:2
modules
sale
lib
delivery
requests
request.php
Создано системой
1.10.0