Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ratelocation.php
1<?php
8namespace Bitrix\Sale\Tax;
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_tax2location';
38 }
39
40 public static function getLinkField()
41 {
42 return 'TAX_RATE_ID';
43 }
44
45 public static function getTargetEntityName()
46 {
47 return 'Bitrix\Sale\Tax\Rate';
48 }
49
50 public static function getLocationLinkField()
51 {
52 return 'LOCATION_CODE';
53 }
54
55 public static function getMap()
56 {
57 return array(
58
59 'TAX_RATE_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' => self::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('?', self::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('?', self::DB_GROUP_FLAG)
89 )
90 ),
91
92 'RATE' => array(
93 'data_type' => static::getTargetEntityName(),
94 'reference' => array(
95 '=this.TAX_RATE_ID' => 'ref.ID'
96 )
97 ),
98 );
99 }
100}