Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Forum.php
1<?php
3
6
7class Forum
8{
9 public static function __callStatic($name, $arguments)
10 {
11 $name = mb_strtoupper($name);
12 switch($name)
13 {
14 case 'ADDTOPIC':
15 case 'UPDATETOPIC':
16 case 'DELETETOPIC':
17
18 if (
19 isset($arguments[0])
20 && (int)$arguments[0]
21 && (!isset($arguments[1]["APPROVED"]) || $arguments[1]["APPROVED"] === 'Y'))
22 {
23 self::processTopic($arguments[0]);
24 }
25
26 break;
27 }
28 }
29
30 protected static function processTopic(int $topicId): void
31 {
32 $topic = \CForumTopic::GetByID($topicId);
33 $forumsForSitemap = ForumTable::query()
34 ->setSelect(['SITEMAP_ID'])
35 ->where('ENTITY_ID', $topic['FORUM_ID'])
36 ->exec()
37 ;
38
39 foreach ($forumsForSitemap as $forum)
40 {
41 Job::markToRegenerate($forum['SITEMAP_ID']);
42 }
43 }
44}
static markToRegenerate(int $sitemapId)
Definition Job.php:199
static processTopic(int $topicId)
Definition Forum.php:30
static __callStatic($name, $arguments)
Definition Forum.php:9