Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
entitytype.php
1
<?php
2
namespace
Bitrix\Sale\Exchange\Integration\Service\User
;
3
4
5
class
EntityType
6
{
7
const
UNDEFINED
= 0;
8
const
TYPE_I
= 1;
9
const
TYPE_E
= 2;
10
11
const
TYPE_I_NAME
=
'I'
;
12
const
TYPE_E_NAME
=
'E'
;
13
14
public
static
function
isDefined
($typeId)
15
{
16
if
(!is_numeric($typeId))
17
{
18
return
false
;
19
}
20
21
$typeId = intval($typeId);
22
return
$typeId >= self::TYPE_I && $typeId <=
self::TYPE_E
;
23
}
24
25
public
static
function
resolveName
($typeId)
26
{
27
if
(!is_numeric($typeId))
28
{
29
return
''
;
30
}
31
32
$typeId = intval($typeId);
33
if
($typeId <= 0)
34
{
35
return
''
;
36
}
37
38
switch
($typeId)
39
{
40
case
self::TYPE_I
:
41
return
self::TYPE_I_NAME
;
42
case
self::TYPE_E
:
43
return
self::TYPE_E_NAME
;
44
case
self::UNDEFINED
:
45
default
:
46
return
''
;
47
}
48
}
49
50
public
static
function
resolveId
($name)
51
{
52
$name = mb_strtoupper(trim($name));
53
if
($name ==
''
)
54
{
55
return
self::UNDEFINED
;
56
}
57
58
switch
($name)
59
{
60
case
self::TYPE_I_NAME
:
61
return
self::TYPE_I
;
62
case
self::TYPE_E_NAME
:
63
return
self::TYPE_E
;
64
default
:
65
return
self::UNDEFINED
;
66
}
67
}
68
}
Bitrix\Sale\Exchange\Integration\Service\User\EntityType
Definition
entitytype.php:6
Bitrix\Sale\Exchange\Integration\Service\User\EntityType\TYPE_E
const TYPE_E
Definition
entitytype.php:9
Bitrix\Sale\Exchange\Integration\Service\User\EntityType\isDefined
static isDefined($typeId)
Definition
entitytype.php:14
Bitrix\Sale\Exchange\Integration\Service\User\EntityType\TYPE_E_NAME
const TYPE_E_NAME
Definition
entitytype.php:12
Bitrix\Sale\Exchange\Integration\Service\User\EntityType\TYPE_I
const TYPE_I
Definition
entitytype.php:8
Bitrix\Sale\Exchange\Integration\Service\User\EntityType\TYPE_I_NAME
const TYPE_I_NAME
Definition
entitytype.php:11
Bitrix\Sale\Exchange\Integration\Service\User\EntityType\resolveName
static resolveName($typeId)
Definition
entitytype.php:25
Bitrix\Sale\Exchange\Integration\Service\User\EntityType\resolveId
static resolveId($name)
Definition
entitytype.php:50
Bitrix\Sale\Exchange\Integration\Service\User\EntityType\UNDEFINED
const UNDEFINED
Definition
entitytype.php:7
Bitrix\Sale\Exchange\Integration\Service\User
modules
sale
lib
exchange
integration
service
user
entitytype.php
Создано системой
1.10.0