Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
binding.php
1
<?php
2
namespace
Bitrix\Landing\Internals
;
3
4
use \Bitrix\Main\Localization\Loc;
5
use \Bitrix\Main\Entity;
6
7
Loc::loadMessages
(__FILE__);
8
25
class
BindingTable
extends
Entity\DataManager
26
{
30
const
ENTITY_TYPE_SITE
=
'S'
;
31
35
const
ENTITY_TYPE_LANDING
=
'L'
;
36
41
public
static
function
getTableName
()
42
{
43
return
'b_landing_binding'
;
44
}
45
50
public
static
function
getMap
()
51
{
52
return
array(
53
'ID'
=>
new
Entity
\
IntegerField
(
'ID'
, array(
54
'primary'
=>
true
,
55
'autocomplete'
=>
true
,
56
'title'
=>
'ID'
57
)),
58
'ENTITY_ID'
=>
new
Entity
\
IntegerField
(
'ENTITY_ID'
, array(
59
'title'
=>
Loc::getMessage
(
'LANDING_TABLE_FIELD_ENTITY_ID'
),
60
'required'
=>
true
61
)),
62
'ENTITY_TYPE'
=>
new
Entity
\
StringField
(
'ENTITY_TYPE'
, array(
63
'title'
=>
Loc::getMessage
(
'LANDING_TABLE_FIELD_ENTITY_TYPE'
),
64
'required'
=>
true
65
)),
66
'BINDING_ID'
=>
new
Entity
\
StringField
(
'BINDING_ID'
, array(
67
'title'
=>
Loc::getMessage
(
'LANDING_TABLE_FIELD_BINDING_ID'
),
68
'required'
=>
true
69
)),
70
'BINDING_TYPE'
=>
new
Entity
\
StringField
(
'BINDING_TYPE'
, array(
71
'title'
=>
Loc::getMessage
(
'LANDING_TABLE_FIELD_BINDING_TYPE'
),
72
'required'
=>
true
73
))
74
);
75
}
76
83
protected
static
function
entityClear
($entityId, $entityType)
84
{
85
$res = self::getList([
86
'select'
=> [
87
'ID'
88
],
89
'filter'
=> [
90
'=ENTITY_TYPE'
=> $entityType,
91
'ENTITY_ID'
=> $entityId
92
]
93
]);
94
while
($row = $res->fetch())
95
{
96
self::delete($row[
'ID'
])->isSuccess();
97
}
98
}
99
105
public
static
function
siteClear
($siteId)
106
{
107
self::entityClear
((
int
) $siteId, self::ENTITY_TYPE_SITE);
108
}
109
}
Bitrix\Landing\Internals\BindingTable
Definition
binding.php:26
Bitrix\Landing\Internals\BindingTable\getMap
static getMap()
Definition
binding.php:50
Bitrix\Landing\Internals\BindingTable\ENTITY_TYPE_SITE
const ENTITY_TYPE_SITE
Definition
binding.php:30
Bitrix\Landing\Internals\BindingTable\entityClear
static entityClear($entityId, $entityType)
Definition
binding.php:83
Bitrix\Landing\Internals\BindingTable\siteClear
static siteClear($siteId)
Definition
binding.php:105
Bitrix\Landing\Internals\BindingTable\ENTITY_TYPE_LANDING
const ENTITY_TYPE_LANDING
Definition
binding.php:35
Bitrix\Landing\Internals\BindingTable\getTableName
static getTableName()
Definition
binding.php:41
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\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Landing\Internals
Definition
base.php:2
modules
landing
lib
internals
binding.php
Создано системой
1.10.0