Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
map.php
1
<?php
2
namespace
Bitrix\Sale\TradingPlatform
;
3
4
use
Bitrix\Main\Entity
;
5
use
Bitrix\Main\Localization\Loc
;
6
Loc::loadMessages
(__FILE__);
7
36
class
MapTable
extends
Entity\DataManager
37
{
38
public
static
function
getFilePath
()
39
{
40
return
__FILE__;
41
}
42
43
public
static
function
getTableName
()
44
{
45
return
'b_sale_tp_map'
;
46
}
47
48
public
static
function
getMap
()
49
{
50
return
array(
51
'ID'
=> array(
52
'data_type'
=>
'integer'
,
53
'primary'
=>
true
,
54
'autocomplete'
=>
true
,
55
'title'
=>
Loc::getMessage
(
'TRADING_PLATFORM_MAP_ENTITY_ID_FIELD'
),
56
),
57
'ENTITY_ID'
=> array(
58
'data_type'
=>
'integer'
,
59
'required'
=>
true
,
60
'title'
=>
Loc::getMessage
(
'TRADING_PLATFORM_MAP_ENTITY_ENTITY_ID_FIELD'
),
61
),
62
'VALUE_EXTERNAL'
=> array(
63
'data_type'
=>
'string'
,
64
'required'
=>
true
,
65
'validation'
=> array(__CLASS__,
'validateValueExternal'
),
66
'title'
=>
Loc::getMessage
(
'TRADING_PLATFORM_MAP_ENTITY_VALUE_EXTERNAL_FIELD'
),
67
),
68
'VALUE_INTERNAL'
=> array(
69
'data_type'
=>
'string'
,
70
'required'
=>
true
,
71
'validation'
=> array(__CLASS__,
'validateValueInternal'
),
72
'title'
=>
Loc::getMessage
(
'TRADING_PLATFORM_MAP_ENTITY_VALUE_INTERNAL_FIELD'
),
73
),
74
'PARAMS'
=> array(
75
'data_type'
=>
'text'
,
76
'serialized'
=>
true
,
77
'title'
=>
Loc::getMessage
(
'TRADING_PLATFORM_MAP_ENTITY_PARAMS_FIELD'
),
78
)
79
);
80
}
81
82
public
static
function
validateValueExternal
()
83
{
84
return
array(
85
new
Entity
\Validator\Length(
null
, 255),
86
);
87
}
88
public
static
function
validateValueInternal
()
89
{
90
return
array(
91
new
Entity
\Validator\Length(
null
, 255),
92
);
93
}
94
99
public
static
function
deleteByMapEntityId
($mapEntityId)
100
{
101
$con = \Bitrix\Main\Application::getConnection();
102
$sqlHelper = $con->getSqlHelper();
103
$tableName =
self::getTableName
();
104
105
$strSql =
106
"DELETE FROM "
.$tableName.
" "
.
107
"WHERE ENTITY_ID="
.$sqlHelper->forSql($mapEntityId);
108
109
$con->queryExecute($strSql);
110
}
111
}
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\Entity
Definition
entity.php:26
Bitrix\Sale\TradingPlatform\MapTable
Definition
map.php:37
Bitrix\Sale\TradingPlatform\MapTable\getMap
static getMap()
Definition
map.php:48
Bitrix\Sale\TradingPlatform\MapTable\getFilePath
static getFilePath()
Definition
map.php:38
Bitrix\Sale\TradingPlatform\MapTable\validateValueInternal
static validateValueInternal()
Definition
map.php:88
Bitrix\Sale\TradingPlatform\MapTable\validateValueExternal
static validateValueExternal()
Definition
map.php:82
Bitrix\Sale\TradingPlatform\MapTable\deleteByMapEntityId
static deleteByMapEntityId($mapEntityId)
Definition
map.php:99
Bitrix\Sale\TradingPlatform\MapTable\getTableName
static getTableName()
Definition
map.php:43
Bitrix\Sale\TradingPlatform
Definition
catalogsectiontab.php:3
modules
sale
lib
tradingplatform
map.php
Создано системой
1.10.0