Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sitelocation.php
1<?php
9
27{
28 const ALL_SITES = '*';
29
30 public static function getFilePath()
31 {
32 return __FILE__;
33 }
34
35 public static function getTableName()
36 {
37 return 'b_sale_loc_2site';
38 }
39
40 public static function getLinkField()
41 {
42 return 'SITE_ID';
43 }
44
45 public static function getTargetEntityName()
46 {
47 return 'Bitrix\Main\Site';
48 }
49
50 public static function getUseLinkTracking()
51 {
52 return true;
53 }
54
55 public static function getTargetEntityPrimaryField()
56 {
57 return 'LID';
58 }
59
60 public static function onAfterModifiy()
61 {
62 // todo: re-generate index here later
63
64 Search\Finder::setIndexInvalid();
65 }
66
67 public static function getMap()
68 {
69 return array(
70
71 'SITE_ID' => array(
72 'data_type' => 'string',
73 'required' => true,
74 'primary' => true
75 ),
76 'LOCATION_ID' => array(
77 'data_type' => 'integer',
78 'required' => true,
79 'primary' => true
80 ),
81 'LOCATION_TYPE' => array(
82 'data_type' => 'string',
83 'default_value' => self::DB_LOCATION_FLAG,
84 'required' => true,
85 'primary' => true
86 ),
87
88 // virtual
89 'LOCATION' => array(
90 'data_type' => '\Bitrix\Sale\Location\Location',
91 'reference' => array(
92 '=this.LOCATION_ID' => 'ref.ID',
93 '=this.LOCATION_TYPE' => array('?', self::DB_LOCATION_FLAG)
94 ),
95 'join_type' => 'inner'
96 ),
97 'GROUP' => array(
98 'data_type' => '\Bitrix\Sale\Location\Group',
99 'reference' => array(
100 '=this.LOCATION_ID' => 'ref.ID',
101 '=this.LOCATION_TYPE' => array('?', self::DB_GROUP_FLAG)
102 )
103 ),
104
105 'SITE' => array(
106 'data_type' => '\Bitrix\Main\Site',
107 'reference' => array(
108 '=this.SITE_ID' => 'ref.LID'
109 )
110 ),
111
112 );
113 }
114}
115