Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
deliverylocation.php
1<?php
9
10use Bitrix\Sale;
11
29{
30 public static function getFilePath()
31 {
32 return __FILE__;
33 }
34
35 public static function getTableName()
36 {
37 return 'b_sale_delivery2location';
38 }
39
40 public static function getLinkField()
41 {
42 return 'DELIVERY_ID';
43 }
44
45 public static function getLocationLinkField()
46 {
47 return 'LOCATION_CODE';
48 }
49
50 public static function getTargetEntityName()
51 {
52 return 'Bitrix\Sale\Delivery\Services\Table';
53 }
54
55 public static function getMap()
56 {
57 return array(
58
59 'DELIVERY_ID' => array(
60 'data_type' => 'integer',
61 'required' => true,
62 'primary' => true
63 ),
64 'LOCATION_CODE' => array(
65 'data_type' => 'string',
66 'required' => true,
67 'primary' => true
68 ),
69 'LOCATION_TYPE' => array(
70 'data_type' => 'string',
71 'default_value' => static::DB_LOCATION_FLAG,
72 'required' => true,
73 'primary' => true
74 ),
75
76 // virtual
77 'LOCATION' => array(
78 'data_type' => '\Bitrix\Sale\Location\Location',
79 'reference' => array(
80 '=this.LOCATION_CODE' => 'ref.CODE',
81 '=this.LOCATION_TYPE' => array('?', static::DB_LOCATION_FLAG)
82 )
83 ),
84 'GROUP' => array(
85 'data_type' => '\Bitrix\Sale\Location\Group',
86 'reference' => array(
87 '=this.LOCATION_CODE' => 'ref.CODE',
88 '=this.LOCATION_TYPE' => array('?', static::DB_GROUP_FLAG)
89 )
90 ),
91
92 'DELIVERY' => array(
93 'data_type' => static::getTargetEntityName(),
94 'reference' => array(
95 '=this.DELIVERY_ID' => 'ref.ID'
96 )
97 ),
98 );
99 }
100}