Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
demos.php
1
<?php
2
namespace
Bitrix\Landing
;
3
4
class
Demos
extends
\Bitrix\Landing\Internals\BaseTable
5
{
9
const
TPL_TYPE_SITE
=
'S'
;
10
14
const
TPL_TYPE_PAGE
=
'P'
;
15
20
public
static
$internalClass
=
'DemosTable'
;
21
27
public
static
function
deleteByAppCode
($code)
28
{
29
$demos = [];
30
31
// delete blocks from repo
32
$res = self::getList([
33
'select'
=> [
34
'ID'
,
'APP_CODE'
,
'XML_ID'
35
],
36
'filter'
=> [
37
'=APP_CODE'
=> $code
38
]
39
]);
40
while
($row = $res->fetch())
41
{
42
$demos[$row[
'APP_CODE'
] .
'.'
. $row[
'XML_ID'
]] = $row;
43
self::delete($row[
'ID'
]);
44
}
45
46
// and pages, which created with this templates
47
if
($demos)
48
{
49
$res =
Landing::getList
([
50
'select'
=> [
51
'ID'
52
],
53
'filter'
=> [
54
'=TPL_CODE'
=> array_keys($demos)
55
]
56
]);
57
while
($row = $res->fetch())
58
{
59
Landing::delete
($row[
'ID'
],
true
);
60
}
61
}
62
63
unset($demos, $row, $res);
64
}
65
}
Bitrix\Landing\Demos
Definition
demos.php:5
Bitrix\Landing\Demos\deleteByAppCode
static deleteByAppCode($code)
Definition
demos.php:27
Bitrix\Landing\Demos\TPL_TYPE_PAGE
const TPL_TYPE_PAGE
Definition
demos.php:14
Bitrix\Landing\Demos\$internalClass
static $internalClass
Definition
demos.php:20
Bitrix\Landing\Demos\TPL_TYPE_SITE
const TPL_TYPE_SITE
Definition
demos.php:9
Bitrix\Landing\History\Action\BaseAction\delete
delete()
Definition
BaseAction.php:35
Bitrix\Landing\Internals\BaseTable
Definition
base.php:7
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Definition
datamanager.php:441
Bitrix\Landing
Definition
agent.php:2
modules
landing
lib
demos.php
Создано системой
1.10.0