Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Runtime.php
1<?php
2
4
6
7class RuntimeTable extends Entity\DataManager
8{
9 const ACTIVE = 'Y';
10 const INACTIVE = 'N';
11
12 const ITEM_TYPE_DIR = 'D';
13 const ITEM_TYPE_FILE = 'F';
14 const ITEM_TYPE_IBLOCK = 'I';
15 const ITEM_TYPE_SECTION = 'S';
16 const ITEM_TYPE_ELEMENT = 'E';
17 const ITEM_TYPE_FORUM = 'G';
18 const ITEM_TYPE_TOPIC = 'T';
19
20 const PROCESSED = 'Y';
21 const UNPROCESSED = 'N';
22
23 public static function getFilePath(): string
24 {
25 return __FILE__;
26 }
27
28 public static function getTableName()
29 {
30 return 'b_seo_sitemap_runtime';
31 }
32
33 public static function getMap()
34 {
35 $fieldsMap = [
36 'ID' => [
37 'data_type' => 'integer',
38 'primary' => true,
39 'autocomplete' => true,
40 ],
41 'PID' => [
42 'data_type' => 'integer',
43 'required' => true,
44 ],
45 'PROCESSED' => [
46 'data_type' => 'boolean',
48 ],
49 'ITEM_PATH' => [
50 'data_type' => 'string',
51 ],
52 'ITEM_ID' => [
53 'data_type' => 'integer',
54 ],
55 'ITEM_TYPE' => [
56 'data_type' => 'enum',
57 'values' => [
65 ],
66 ],
67 'ACTIVE' => [
68 'data_type' => 'boolean',
69 'values' => [self::INACTIVE, self::ACTIVE],
70 ],
71 'ACTIVE_ELEMENT' => [
72 'data_type' => 'boolean',
73 'values' => [self::INACTIVE, self::ACTIVE],
74 ],
75 ];
76
77 return $fieldsMap;
78 }
79
80 public static function clearByPid($PID)
81 {
82 $connection = \Bitrix\Main\Application::getConnection();
83 $query = $connection->query("
84DELETE
85FROM " . self::getTableName() . "
86WHERE PID='" . intval($PID) . "'
87");
88 }
89}