Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
type.php
1<?php
3
4class Type
5{
6 const UNDEFINED = 0;
7 const DEFAULT_TOOLBAR = 1;
9
10 const DEFAULT_TOOLBAR_NAME = 'DEFAULT';
11 const DEAL_DETAIL_TOOLBAR_NAME = 'CRM_DEAL_DETAIL_TOOLBAR';
12
13 const FIRST_TYPE = 1;
14 const LAST_TYPE = 2;
15
16 public static function isDefined($typeId)
17 {
18 if(!is_int($typeId))
19 {
20 $typeId = (int)$typeId;
21 }
22
23 return $typeId >= self::FIRST_TYPE && $typeId <= self::LAST_TYPE;
24 }
25
26 public static function resolveId($name)
27 {
28 if($name == '')
29 {
30 return self::UNDEFINED;
31 }
32
33 switch($name)
34 {
39
40 default:
41 return self::UNDEFINED;
42 }
43 }
44
45 public static function resolveName($typeId)
46 {
47 if(!is_numeric($typeId))
48 {
49 return '';
50 }
51
52 $typeId = intval($typeId);
53 if($typeId <= 0)
54 {
55 return '';
56 }
57
58 switch($typeId)
59 {
64
65 case self::UNDEFINED:
66 default:
67 return '';
68 }
69 }
70}