Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
shipment.php
1
<?php
2
namespace
Bitrix\Sale\Delivery\Requests
;
3
4
use
Bitrix\Main\Entity
;
5
use
Bitrix\Main\Localization\Loc
;
6
7
Loc::loadMessages
(__FILE__);
8
37
class
ShipmentTable
extends
Entity\DataManager
38
{
44
public
static
function
getTableName
()
45
{
46
return
'b_sale_delivery_req_shp'
;
47
}
48
54
public
static
function
getMap
()
55
{
56
return
array(
57
'ID'
=> array(
58
'data_type'
=>
'integer'
,
59
'primary'
=>
true
,
60
'autocomplete'
=>
true
,
61
'title'
=>
Loc::getMessage
(
'SALE_DLVR_REQ_SHP_TBL_ID_FIELD'
),
62
),
63
'SHIPMENT_ID'
=> array(
64
'data_type'
=>
'integer'
,
65
'required'
=>
true
,
66
'title'
=>
Loc::getMessage
(
'SALE_DLVR_REQ_SHP_TBL_SHIPMENT_ID_FIELD'
),
67
),
68
'REQUEST_ID'
=> array(
69
'data_type'
=>
'integer'
,
70
'title'
=>
Loc::getMessage
(
'SALE_DLVR_REQ_SHP_TBL_REQUEST_ID_FIELD'
),
71
),
72
'EXTERNAL_ID'
=> array(
73
'data_type'
=>
'string'
,
74
'validation'
=> array(__CLASS__,
'validateType'
),
75
'title'
=>
Loc::getMessage
(
'SALE_DLVR_REQ_SHP_TBL_EXTERNAL_ID_FIELD'
),
76
),
77
'ERROR_DESCRIPTION'
=> array(
78
'data_type'
=>
'string'
,
79
'validation'
=> array(__CLASS__,
'validateErrorDescription'
),
80
'title'
=>
Loc::getMessage
(
'SALE_DLVR_REQ_SHP_TBL_ERROR_DESCRIPTION_FIELD'
),
81
),
82
'SHIPMENT'
=> array(
83
'data_type'
=>
'\Bitrix\Sale\Internals\ShipmentTable'
,
84
'reference'
=> array(
'=this.SHIPMENT_ID'
=>
'ref.ID'
),
85
),
86
'REQUEST'
=> array(
87
'data_type'
=>
'\Bitrix\Sale\Delivery\Requests\RequestTable'
,
88
'reference'
=> array(
'=this.REQUEST_ID'
=>
'ref.ID'
),
89
)
90
);
91
}
92
96
public
static
function
validateType
()
97
{
98
return
array(
99
new
Entity
\Validator\Length(
null
, 50),
100
);
101
}
102
106
public
static
function
validateErrorDescription
()
107
{
108
return
array(
109
new
Entity
\Validator\Length(
null
, 2048),
110
);
111
}
112
113
public
static
function
setShipment
(array $fields)
114
{
115
$res = self::getList(array(
'filter'
=> array(
'=SHIPMENT_ID'
=> $fields[
'SHIPMENT_ID'
])));
116
117
if
($row = $res->fetch())
118
$result = self::update($row[
'ID'
], $fields);
119
else
120
$result = self::add($fields);
121
122
return
$result;
123
}
124
}
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\Sale\Delivery\Requests\ShipmentTable
Definition
shipment.php:38
Bitrix\Sale\Delivery\Requests\ShipmentTable\setShipment
static setShipment(array $fields)
Definition
shipment.php:113
Bitrix\Sale\Delivery\Requests\ShipmentTable\getMap
static getMap()
Definition
shipment.php:54
Bitrix\Sale\Delivery\Requests\ShipmentTable\validateType
static validateType()
Definition
shipment.php:96
Bitrix\Sale\Delivery\Requests\ShipmentTable\validateErrorDescription
static validateErrorDescription()
Definition
shipment.php:106
Bitrix\Sale\Delivery\Requests\ShipmentTable\getTableName
static getTableName()
Definition
shipment.php:44
Bitrix\Sale\Delivery\Requests
Definition
handlerbase.php:2
modules
sale
lib
delivery
requests
shipment.php
Создано системой
1.10.0