Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
table.php
1
<?php
2
3
namespace
Bitrix\Sale\Delivery\Services
;
4
5
use
Bitrix\Main\Application
;
6
use
Bitrix\Main\Entity
;
7
use
Bitrix\Main\Localization\Loc
;
8
use
Bitrix\Main\ORM\Data\DeleteResult
;
9
use
Bitrix\Sale\Delivery\Services
;
10
11
Loc::loadMessages
(__FILE__);
12
48
class
Table
extends
Entity\DataManager
49
{
50
public
static
function
getFilePath
()
51
{
52
return
__FILE__;
53
}
54
55
public
static
function
getTableName
()
56
{
57
return
'b_sale_delivery_srv'
;
58
}
59
60
public
static
function
getMap
()
61
{
62
return
array(
63
'ID'
=> array(
64
'data_type'
=>
'integer'
,
65
'primary'
=>
true
,
66
'autocomplete'
=>
true
,
67
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_ID_FIELD'
),
68
),
69
'CODE'
=> array(
70
'data_type'
=>
'string'
,
71
'validation'
=> array(__CLASS__,
'validateCode'
),
72
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_CODE_FIELD'
),
73
),
74
'PARENT_ID'
=> array(
75
'data_type'
=>
'integer'
,
76
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_PARENT_ID_FIELD'
),
77
),
78
'PARENT'
=> array(
79
'data_type'
=>
'\Bitrix\Sale\Delivery\Services\Table'
,
80
'reference'
=> array(
81
'=this.PARENT_ID'
=>
'ref.ID'
82
)
83
),
84
'NAME'
=> array(
85
'data_type'
=>
'string'
,
86
'required'
=>
true
,
87
'validation'
=> array(__CLASS__,
'validateName'
),
88
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_NAME_FIELD'
),
89
),
90
'ACTIVE'
=> array(
91
'data_type'
=>
'boolean'
,
92
'values'
=> array(
'N'
,
'Y'
),
93
'required'
=>
true
,
94
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_ACTIVE_FIELD'
),
95
),
96
'DESCRIPTION'
=> array(
97
'data_type'
=>
'string'
,
98
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_DESCRIPTION_FIELD'
),
99
),
100
'SORT'
=> array(
101
'data_type'
=>
'integer'
,
102
'default_value'
=> 100,
103
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_SORT_FIELD'
),
104
),
105
'LOGOTIP'
=> array(
106
'data_type'
=>
'integer'
,
107
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_LOGOTIP_FIELD'
),
108
),
109
'CONFIG'
=> array(
110
'data_type'
=>
'text'
,
111
'serialized'
=>
true
,
112
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_CONFIG_FIELD'
),
113
),
114
'CLASS_NAME'
=> array(
115
'data_type'
=>
'string'
,
116
'validation'
=> array(__CLASS__,
'validateClassName'
),
117
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_CLASS_NAME_FIELD'
),
118
),
119
'CURRENCY'
=> array(
120
'data_type'
=>
'string'
,
121
'validation'
=> array(__CLASS__,
'validateCurrency'
),
122
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_CURRENCY_FIELD'
),
123
),
124
'TRACKING_PARAMS'
=> array(
125
'data_type'
=>
'text'
,
126
'serialized'
=>
true
,
127
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_TRACKING_PARAMS_FIELD'
),
128
),
129
'ALLOW_EDIT_SHIPMENT'
=> array(
130
'data_type'
=>
'boolean'
,
131
'values'
=> array(
'N'
,
'Y'
),
132
'default_value'
=>
'Y'
,
133
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_ALLOW_EDIT_SHIPMENT_FIELD'
)
134
),
135
'VAT_ID'
=> array(
136
'data_type'
=>
'integer'
,
137
'title'
=>
Loc::getMessage
(
'DELIVERY_SERVICE_ENTITY_VAT_ID_FIELD'
)
138
),
139
'XML_ID'
=> array(
140
'data_type'
=>
'string'
,
141
),
142
);
143
}
144
145
public
static
function
validateCode
()
146
{
147
return
array(
148
new
Entity
\Validator\Length(
null
, 50),
149
);
150
}
151
public
static
function
validateName
()
152
{
153
return
array(
154
new
Entity
\Validator\Length(
null
, 255),
155
);
156
}
157
public
static
function
validateCurrency
()
158
{
159
return
array(
160
new
Entity
\Validator\Length(
null
, 3),
161
);
162
}
163
public
static
function
validateClassName
()
164
{
165
return
array(
166
new
Entity
\Validator\Length(
null
, 255),
167
);
168
}
169
170
/* Deprecated methods moved to manager. Will be removed in future versions. */
171
175
public
static
function
getIdByCode
($code)
176
{
177
return
Services\Manager::getIdByCode($code);
178
}
179
183
public
static
function
getCodeById
($id)
184
{
185
return
Services\Manager::getCodeById($id);
186
}
187
193
public
static
function
delete
($primary)
194
{
195
if
($primary ==
EmptyDeliveryService::getEmptyDeliveryServiceId
())
196
{
197
$cacheManager =
Application::getInstance
()->getManagedCache();
198
$cacheManager->clean(
EmptyDeliveryService::CACHE_ID
);
199
}
200
201
return
parent::delete($primary);
202
}
203
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getInstance
static getInstance()
Definition
application.php:95
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Data\DeleteResult
Definition
deleteresult.php:12
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Sale\Delivery\ExtraServices\Table
Definition
table.php:45
Bitrix\Sale\Delivery\Services\EmptyDeliveryService\CACHE_ID
const CACHE_ID
Definition
emptydeliveryservice.php:22
Bitrix\Sale\Delivery\Services\EmptyDeliveryService\getEmptyDeliveryServiceId
static getEmptyDeliveryServiceId()
Definition
emptydeliveryservice.php:45
Bitrix\Sale\Delivery\Services\Table\getMap
static getMap()
Definition
table.php:60
Bitrix\Sale\Delivery\Services\Table\getFilePath
static getFilePath()
Definition
table.php:50
Bitrix\Sale\Delivery\Services\Table\getCodeById
static getCodeById($id)
Definition
table.php:183
Bitrix\Sale\Delivery\Services\Table\getIdByCode
static getIdByCode($code)
Definition
table.php:175
Bitrix\Sale\Delivery\Services\Table\validateCurrency
static validateCurrency()
Definition
table.php:157
Bitrix\Sale\Delivery\Services\Table\validateClassName
static validateClassName()
Definition
table.php:163
Bitrix\Sale\Delivery\Services\Table\validateName
static validateName()
Definition
table.php:151
Bitrix\Sale\Delivery\Services\Table\getTableName
static getTableName()
Definition
table.php:55
Bitrix\Sale\Delivery\Services\Table\validateCode
static validateCode()
Definition
table.php:145
Bitrix\Sale\Delivery\Services
Definition
automatic.php:3
modules
sale
lib
delivery
services
table.php
Создано системой
1.10.0