Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
demos.php
1<?php
2namespace Bitrix\Landing;
3
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}
static deleteByAppCode($code)
Definition demos.php:27
static $internalClass
Definition demos.php:20
const TPL_TYPE_SITE
Definition demos.php:9
static getList(array $parameters=array())