Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
page.php
1
<?
2
namespace
Bitrix\Main\Composite\Internals\Model
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Main\Application
;
6
use
Bitrix\Main\Localization\Loc
;
7
use
Bitrix\Main\Type\DateTime
;
8
9
Loc::loadMessages
(__FILE__);
10
43
class
PageTable
extends
Main\Entity\DataManager
44
{
50
public
static
function
getTableName
()
51
{
52
return
"b_composite_page"
;
53
}
54
60
public
static
function
getMap
()
61
{
62
return
array(
63
"ID"
=> array(
64
"data_type"
=>
"integer"
,
65
"primary"
=>
true
,
66
"autocomplete"
=>
true
,
67
"title"
=>
"ID"
,
68
),
69
"CACHE_KEY"
=> array(
70
"data_type"
=>
"string"
,
71
"required"
=>
true
,
72
"validation"
=> array(__CLASS__,
"validateCacheKey"
),
73
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_CACHE_KEY_FIELD"
),
74
),
75
"HOST"
=> array(
76
"data_type"
=>
"string"
,
77
"required"
=>
true
,
78
"validation"
=> array(__CLASS__,
"validateHost"
),
79
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_HOST_FIELD"
),
80
),
81
"URI"
=> array(
82
"data_type"
=>
"string"
,
83
"required"
=>
true
,
84
"validation"
=> array(__CLASS__,
"validateUri"
),
85
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_URI_FIELD"
),
86
),
87
"TITLE"
=> array(
88
"data_type"
=>
"string"
,
89
"validation"
=> array(__CLASS__,
"validateTitle"
),
90
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_TITLE_FIELD"
),
91
),
92
"CREATED"
=> array(
93
"data_type"
=>
"datetime"
,
94
"required"
=>
true
,
95
"default_value"
=>
new
DateTime
(),
96
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_CREATED_FIELD"
),
97
),
98
"CHANGED"
=> array(
99
"data_type"
=>
"datetime"
,
100
"required"
=>
true
,
101
"default_value"
=>
new
DateTime
(),
102
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_CHANGED_FIELD"
),
103
),
104
"LAST_VIEWED"
=> array(
105
"data_type"
=>
"datetime"
,
106
"required"
=>
true
,
107
"default_value"
=>
new
DateTime
(),
108
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_LAST_VIEWED_FIELD"
),
109
),
110
"VIEWS"
=> array(
111
"data_type"
=>
"integer"
,
112
"required"
=>
true
,
113
"default_value"
=> 0,
114
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_VIEWS_FIELD"
),
115
),
116
"REWRITES"
=> array(
117
"data_type"
=>
"integer"
,
118
"required"
=>
true
,
119
"default_value"
=> 0,
120
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_REWRITES_FIELD"
),
121
),
122
"SIZE"
=> array(
123
"data_type"
=>
"integer"
,
124
"required"
=>
true
,
125
"default_value"
=> 0,
126
"title"
=>
Loc::getMessage
(
"PAGE_ENTITY_SIZE_FIELD"
),
127
),
128
);
129
}
130
136
public
static
function
validateCacheKey
()
137
{
138
return
array(
139
new
Main\
Entity
\Validator\Length(
null
, 2000),
140
);
141
}
142
148
public
static
function
validateHost
()
149
{
150
return
array(
151
new
Main\
Entity
\Validator\Length(
null
, 100),
152
);
153
}
154
160
public
static
function
validateUri
()
161
{
162
return
array(
163
new
Main\
Entity
\Validator\Length(
null
, 2000),
164
);
165
}
166
172
public
static
function
validateTitle
()
173
{
174
return
array(
175
new
Main\
Entity
\Validator\Length(
null
, 250),
176
);
177
}
178
179
public
static
function
deleteAll
()
180
{
181
$tableName = static::getTableName();
182
$connection =
Application::getConnection
();
183
$connection->queryExecute(
"DELETE FROM {$tableName}"
);
184
}
185
192
public
static
function
deleteBatch
(array $filter)
193
{
194
$tableName = static::getTableName();
195
$connection =
Application::getConnection
();
196
if
(isset($filter[
"ID"
]) && is_array($filter[
"ID"
]) && !empty($filter[
"ID"
]))
197
{
198
$ids = implode(
","
, array_map(
"intval"
, $filter[
"ID"
]));
199
$connection->queryExecute(
"DELETE FROM {$tableName} WHERE ID IN ($ids)"
);
200
}
201
}
202
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getConnection
static getConnection($name="")
Definition
application.php:611
Bitrix\Main\Composite\Internals\Model\PageTable
Definition
page.php:44
Bitrix\Main\Composite\Internals\Model\PageTable\getMap
static getMap()
Definition
page.php:60
Bitrix\Main\Composite\Internals\Model\PageTable\validateUri
static validateUri()
Definition
page.php:160
Bitrix\Main\Composite\Internals\Model\PageTable\validateCacheKey
static validateCacheKey()
Definition
page.php:136
Bitrix\Main\Composite\Internals\Model\PageTable\validateHost
static validateHost()
Definition
page.php:148
Bitrix\Main\Composite\Internals\Model\PageTable\validateTitle
static validateTitle()
Definition
page.php:172
Bitrix\Main\Composite\Internals\Model\PageTable\deleteAll
static deleteAll()
Definition
page.php:179
Bitrix\Main\Composite\Internals\Model\PageTable\deleteBatch
static deleteBatch(array $filter)
Definition
page.php:192
Bitrix\Main\Composite\Internals\Model\PageTable\getTableName
static getTableName()
Definition
page.php:50
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\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Main\Composite\Internals\Model
Definition
page.php:2
Bitrix\Main
modules
main
lib
composite
internals
model
page.php
Создано системой
1.10.0