Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
collection.php
1
<?php
2
3
namespace
Bitrix\Location\Geometry\Type
;
4
5
use
Bitrix\Main\SystemException
;
6
15
abstract
class
Collection
extends
BaseGeometry
16
{
18
protected
$components
= [];
19
25
public
function
__construct
(array
$components
= [])
26
{
27
foreach
(
$components
as $component)
28
{
29
if
($component instanceof
BaseGeometry
)
30
{
31
$this->components[] = $component;
32
}
33
else
34
{
35
throw
new
SystemException
(
'Cannot create a collection with non-geometries'
);
36
}
37
}
38
}
39
43
public
function
getComponents
(): array
44
{
45
return
$this->components
;
46
}
47
51
public
function
getComponentsCount
(): int
52
{
53
return
count($this->components);
54
}
55
59
public
function
asArray
(): array
60
{
61
$result = [];
62
63
foreach
($this->components as $component)
64
{
65
$result[] = $component->asArray();
66
}
67
68
return
$result;
69
}
70
}
Bitrix\Location\Geometry\Type\BaseGeometry
Definition
basegeometry.php:6
Bitrix\Location\Geometry\Type\Collection
Definition
collection.php:16
Bitrix\Location\Geometry\Type\Collection\asArray
asArray()
Definition
collection.php:59
Bitrix\Location\Geometry\Type\Collection\$components
$components
Definition
collection.php:18
Bitrix\Location\Geometry\Type\Collection\__construct
__construct(array $components=[])
Definition
collection.php:25
Bitrix\Location\Geometry\Type\Collection\getComponents
getComponents()
Definition
collection.php:43
Bitrix\Location\Geometry\Type\Collection\getComponentsCount
getComponentsCount()
Definition
collection.php:51
Bitrix\Main\SystemException
Definition
exception.php:8
Bitrix\Location\Geometry\Type
Definition
basegeometry.php:3
modules
location
lib
geometry
type
collection.php
Создано системой
1.10.0