1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
possiblelengthfield.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\PhoneNumber\Tools;
4
5
use Bitrix\Main\SystemException;
6
7
class
PossibleLengthField
extends
XmlField
8
{
9
public
function
decodeValue
($value)
10
{
11
return
static::parsePossibleLength($value);
12
}
13
19
public
static
function
parsePossibleLength
($possibleLength)
20
{
21
$result
=
array
();
22
$tokens = explode(
','
, $possibleLength);
23
foreach
($tokens as $token)
24
{
25
if
(preg_match(
'/^\d+$/'
, $token))
26
{
27
$result
[] = (int)$token;
28
}
29
else
if
(preg_match(
'/^\[(\d+)-(\d+)\]$/'
, $token,
$matches
))
30
{
31
$start
=
$matches
[1];
32
$end =
$matches
[2];
33
$result
= array_merge(
$result
, range(
$start
, $end));
34
}
35
else
36
{
37
throw
new
SystemException
(
"Unrecognized token: "
, $token);
38
}
39
}
40
return
$result
;
41
}
42
43
}
Bitrix\Main\PhoneNumber\Tools\PossibleLengthField
Определения
possiblelengthfield.php:8
Bitrix\Main\PhoneNumber\Tools\PossibleLengthField\parsePossibleLength
static parsePossibleLength($possibleLength)
Определения
possiblelengthfield.php:19
Bitrix\Main\PhoneNumber\Tools\PossibleLengthField\decodeValue
decodeValue($value)
Определения
possiblelengthfield.php:9
Bitrix\Main\PhoneNumber\Tools\XmlField
Определения
xmlfield.php:6
Bitrix\Main\SystemException
Определения
SystemException.php:9
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$start
$start
Определения
get_search.php:9
$matches
$matches
Определения
index.php:22
bitrix
modules
main
lib
phonenumber
tools
possiblelengthfield.php
Создано системой
1.14.0