Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
payableitem.php
1<?php
2
4
9
28{
32 public static function getTableName()
33 {
34 return 'b_sale_order_payment_item';
35 }
36
40 public static function getMap()
41 {
42 global $DB;
43
44 return [
45 'ID' => [
46 'data_type' => 'integer',
47 'primary' => true,
48 'autocomplete' => true,
49 ],
50 'ENTITY_ID' => [
51 'data_type' => 'integer',
52 'required' => true,
53 ],
54 'ENTITY_TYPE' => [
55 'data_type' => 'enum',
56 'required' => true,
57 'values' => [
58 Sale\Registry::ENTITY_BASKET_ITEM,
59 Sale\Registry::ENTITY_SHIPMENT,
60 ]
61 ],
62 'PAYMENT_ID' => [
63 'data_type' => 'integer',
64 'required' => true,
65 ],
66 'DATE_INSERT' => [
67 'data_type' => 'datetime'
68 ],
69 'DATE_INSERT_SHORT' => [
70 'data_type' => 'datetime',
71 'expression' => [
72 $DB->datetimeToDateFunction('%s'), 'DATE_INSERT'
73 ]
74 ],
75 'QUANTITY' => [
76 'data_type' => 'float',
77 'required' => true,
78 ],
79 'XML_ID' => [
80 'data_type' => 'string'
81 ],
82 //
83 'PAYMENT' => new Reference(
84 'PAYMENT',
85 PaymentTable::class,
86 Join::on('this.PAYMENT_ID', 'ref.ID')
87 ),
88 'BASKET' => new Reference(
89 'BASKET',
90 BasketTable::class,
91 Join::on('this.ENTITY_ID', 'ref.ID')->where('this.ENTITY_TYPE', Sale\Registry::ENTITY_BASKET_ITEM)
92 ),
93 'SHIPMENT' => new Reference(
94 'SHIPMENT',
95 ShipmentTable::class,
96 Join::on('this.ENTITY_ID', 'ref.ID')->where('this.ENTITY_TYPE', Sale\Registry::ENTITY_SHIPMENT)
97 ),
98 ];
99 }
100}