Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
type.php
1
<?php
2
namespace
Bitrix\Sale\Exchange\Integration\CRM\Placement
;
3
4
class
Type
5
{
6
const
UNDEFINED
= 0;
7
const
DEFAULT_TOOLBAR
= 1;
8
const
DEAL_DETAIL_TOOLBAR
= 2;
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
{
35
case
self::DEFAULT_TOOLBAR_NAME
:
36
return
self::DEFAULT_TOOLBAR
;
37
case
self::DEAL_DETAIL_TOOLBAR_NAME
:
38
return
self::DEAL_DETAIL_TOOLBAR
;
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
{
60
case
self::DEFAULT_TOOLBAR
:
61
return
self::DEFAULT_TOOLBAR_NAME
;
62
case
self::DEAL_DETAIL_TOOLBAR
:
63
return
self::DEAL_DETAIL_TOOLBAR_NAME
;
64
65
case
self::UNDEFINED
:
66
default
:
67
return
''
;
68
}
69
}
70
}
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\DEFAULT_TOOLBAR_NAME
const DEFAULT_TOOLBAR_NAME
Definition
type.php:10
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\isDefined
static isDefined($typeId)
Definition
type.php:16
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\LAST_TYPE
const LAST_TYPE
Definition
type.php:14
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\FIRST_TYPE
const FIRST_TYPE
Definition
type.php:13
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\resolveName
static resolveName($typeId)
Definition
type.php:45
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\DEAL_DETAIL_TOOLBAR
const DEAL_DETAIL_TOOLBAR
Definition
type.php:8
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\resolveId
static resolveId($name)
Definition
type.php:26
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\UNDEFINED
const UNDEFINED
Definition
type.php:6
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\DEFAULT_TOOLBAR
const DEFAULT_TOOLBAR
Definition
type.php:7
Bitrix\Sale\Exchange\Integration\CRM\Placement\Type\DEAL_DETAIL_TOOLBAR_NAME
const DEAL_DETAIL_TOOLBAR_NAME
Definition
type.php:11
Bitrix\Main\Type
Definition
collection.php:2
Bitrix\Sale\Exchange\Integration\CRM\Placement
Definition
base.php:4
modules
sale
lib
exchange
integration
crm
placement
type.php
Создано системой
1.10.0