Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
type.php
1<?php
2
4
10class Type
11{
12 public const UNKNOWN = 0;
13
14 public const COUNTRY = 100;
15
16 public const ADM_LEVEL_1 = 200;
17 public const ADM_LEVEL_2 = 210;
18 public const ADM_LEVEL_3 = 220;
19 public const ADM_LEVEL_4 = 230;
20
21 public const LOCALITY = 300;
22 public const SUB_LOCALITY = 310;
23 public const SUB_LOCALITY_LEVEL_1 = 320;
24 public const SUB_LOCALITY_LEVEL_2 = 330;
25 public const STREET = 340;
26
27 public const BUILDING = 400;
28 public const ADDRESS_LINE_1 = 410;
29
30 public const FLOOR = 420;
31 public const ROOM = 430;
32
33 public static function isTypeExist(string $type): bool
34 {
35 return defined(static::class.'::'.$type);
36 }
37
38 public static function isValueExist(int $value): bool
39 {
40 $reflection = new \ReflectionClass(static::class);
41 $values = array_values($reflection->getConstants());
42
43 return in_array($value, $values, true);
44 }
45}
static isValueExist(int $value)
Definition type.php:38
static isTypeExist(string $type)
Definition type.php:33