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