Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
shipmentitem.php
1<?php
9
10use Bitrix\Main;
13
14Loc::loadMessages(__FILE__);
15
46{
47
53 public static function getFilePath()
54 {
55 return __FILE__;
56 }
57
58
64 public static function deleteWithItems($id)
65 {
66 $id = intval($id);
67 if ($id <= 0)
68 throw new Main\ArgumentNullException("id");
69
70 $itemsFromDbList = ShipmentItemStoreTable::getList(
71 array(
72 "filter" => array(
73 'ORDER_DELIVERY_BASKET_ID' => $id,
74 ),
75 "select" => array("ID")
76 )
77 );
78 while ($itemsFromDbItem = $itemsFromDbList->fetch())
79 ShipmentItemStoreTable::delete($itemsFromDbItem['ID']);
80
81 return ShipmentItemTable::delete($id);
82 }
83
89 public static function getTableName()
90 {
91 return 'b_sale_order_dlv_basket';
92 }
93
99 public static function getMap()
100 {
101 global $DB;
102
103 return array(
104 'ID' => array(
105 'data_type' => 'integer',
106 'primary' => true,
107 'autocomplete' => true,
108 'title' => Loc::getMessage('ORDER_DELIVERY_BASKET_ENTITY_ID_FIELD'),
109 ),
110 'ORDER_DELIVERY_ID' => array(
111 'data_type' => 'integer',
112 'required' => true,
113 'title' => Loc::getMessage('ORDER_DELIVERY_BASKET_ENTITY_ORDER_DELIVERY_ID_FIELD'),
114 ),
115 'DELIVERY' => array(
116 'data_type' => 'Shipment',
117 'reference' => array(
118 '=this.ORDER_DELIVERY_ID' => 'ref.ID'
119 )
120 ),
121 'BASKET_ID' => array(
122 'data_type' => 'integer',
123 'required' => true,
124 'title' => Loc::getMessage('ORDER_DELIVERY_BASKET_ENTITY_BASKET_ID_FIELD'),
125 ),
126 'BASKET' => array(
127 'data_type' => 'Bitrix\Sale\Internals\Basket',
128 'reference' => array(
129 '=this.BASKET_ID' => 'ref.ID'
130 )
131 ),
132 'DATE_INSERT' => array(
133 'data_type' => 'datetime'
134 ),
135 'DATE_INSERT_SHORT' => array(
136 'data_type' => 'datetime',
137 'expression' => array(
138 $DB->datetimeToDateFunction('%s'), 'DATE_INSERT'
139 )
140 ),
141 'QUANTITY' => array(
142 'data_type' => 'float',
143 'required' => true,
144 'title' => Loc::getMessage('ORDER_DELIVERY_BASKET_ENTITY_QUANTITY_FIELD'),
145 ),
146 'RESERVED_QUANTITY' => array(
147 'data_type' => 'float',
148 'required' => true,
149 'title' => Loc::getMessage('ORDER_DELIVERY_BASKET_ENTITY_RESERVED_QUANTITY_FIELD'),
150 ),
151 'XML_ID' => array('data_type' => 'string'),
152 );
153 }
154}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29