Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
propertyfeature.php
1
<?php
2
namespace
Bitrix\Iblock
;
3
4
use
Bitrix\Main
,
5
Bitrix\Main\ORM
,
6
Bitrix\Main\Localization\Loc
;
7
8
Loc::loadMessages
(__FILE__);
9
39
class
PropertyFeatureTable
extends
ORM\Data\DataManager
40
{
46
public
static
function
getTableName
()
47
{
48
return
'b_iblock_property_feature'
;
49
}
50
56
public
static
function
getMap
()
57
{
58
return
[
59
'ID'
=>
new
ORM\Fields\IntegerField(
'ID'
, [
60
'primary'
=>
true
,
61
'autocomplete'
=>
true
,
62
'title'
=>
Loc::getMessage
(
'PROPERTY_FEATURE_ENTITY_ID_FIELD'
)
63
]),
64
'PROPERTY_ID'
=>
new
ORM\Fields\IntegerField(
'PROPERTY_ID'
, [
65
'title'
=>
Loc::getMessage
(
'PROPERTY_FEATURE_ENTITY_PROPERTY_ID_FIELD'
)
66
]),
67
'MODULE_ID'
=>
new
ORM\Fields\StringField(
'MODULE_ID'
, [
68
'validation'
=> [__CLASS__,
'validateModuleId'
],
69
'title'
=>
Loc::getMessage
(
'PROPERTY_FEATURE_ENTITY_MODULE_ID_FIELD'
)
70
]),
71
'FEATURE_ID'
=>
new
ORM\Fields\StringField(
'FEATURE_ID'
, [
72
'validation'
=> [__CLASS__,
'validateFeatureId'
],
73
'title'
=>
Loc::getMessage
(
'PROPERTY_FEATURE_ENTITY_FEATURE_ID_FIELD'
)
74
]),
75
'IS_ENABLED'
=>
new
ORM\Fields\BooleanField(
'IS_ENABLED'
, [
76
'values'
=> [
'N'
,
'Y'
],
77
'default_value'
=>
'N'
,
78
'title'
=>
Loc::getMessage
(
'PROPERTY_FEATURE_ENTITY_IS_ENABLED_FIELD'
)
79
]),
80
'PROPERTY'
=>
new
ORM\Fields\Relations\Reference
(
81
'PROPERTY'
,
82
'\Bitrix\Iblock\Property'
,
83
[
'=this.PROPERTY_ID'
=>
'ref.ID'
]
84
)
85
];
86
}
87
93
public
static
function
validateModuleId
()
94
{
95
return
[
96
new
ORM\Fields\Validators\LengthValidator
(
null
, 50),
97
];
98
}
99
105
public
static
function
validateFeatureId
()
106
{
107
return
[
108
new
ORM\Fields\Validators\LengthValidator
(
null
, 100),
109
];
110
}
111
118
public
static
function
deleteByProperty
($property)
119
{
120
$property = (int)$property;
121
if
($property <= 0)
122
return
;
123
$conn = Main\Application::getConnection();
124
$helper = $conn->getSqlHelper();
125
$conn->queryExecute(
126
'delete from '
.$helper->quote(self::getTableName()).
' where '
.$helper->quote(
'PROPERTY_ID'
).
' = '
.$property
127
);
128
unset($helper, $conn);
129
}
130
}
Bitrix\Iblock\PropertyFeatureTable
Definition
propertyfeature.php:40
Bitrix\Iblock\PropertyFeatureTable\getMap
static getMap()
Definition
propertyfeature.php:56
Bitrix\Iblock\PropertyFeatureTable\validateFeatureId
static validateFeatureId()
Definition
propertyfeature.php:105
Bitrix\Iblock\PropertyFeatureTable\validateModuleId
static validateModuleId()
Definition
propertyfeature.php:93
Bitrix\Iblock\PropertyFeatureTable\deleteByProperty
static deleteByProperty($property)
Definition
propertyfeature.php:118
Bitrix\Iblock\PropertyFeatureTable\getTableName
static getTableName()
Definition
propertyfeature.php:46
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\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\Relations\Reference
Definition
reference.php:26
Bitrix\Main\ORM\Fields\Validators\LengthValidator
Definition
lengthvalidator.php:19
Bitrix\Iblock
Bitrix\Main\ORM
Bitrix\Main
modules
iblock
lib
propertyfeature.php
Создано системой
1.10.0