Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
manager.php
1<?php
2
4
5class Manager
6{
7 public const TYPE_TASK_INFO = 1;
8 public const TYPE_TASK_CREATED = 2;
9 public const TYPE_ENTITY_CREATED = 3;
10 public const TYPE_FORUM_DEFAULT = 1000;
11
12 public static function getTypesList(): array
13 {
14 return [
15 static::TYPE_TASK_INFO,
16 static::TYPE_TASK_CREATED,
17 static::TYPE_ENTITY_CREATED,
18 ];
19 }
20
21 final public static function find(array $params = [])
22 {
23 $commentType = (isset($params['SERVICE_TYPE']) ? (int)$params['SERVICE_TYPE'] : 0);
24
25 if ($commentType <= 0)
26 {
27 return false;
28 }
29
30 switch ($commentType)
31 {
32 case static::TYPE_TASK_INFO:
33 $result = new TaskInfo();
34 break;
35 case static::TYPE_TASK_CREATED:
36 $result = new TaskCreated();
37 break;
38 case static::TYPE_ENTITY_CREATED:
39 $result = new EntityCreated();
40 break;
41 default:
42 $result = false;
43 }
44
45 return $result;
46 }
47}
static find(array $params=[])
Definition manager.php:21