1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
parents.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Location\Entity\Location;
4
5
use Bitrix\Location\Entity\Location;
6
12
final
class
Parents
extends
Collection
13
{
15
protected
$items
= [];
17
protected
$descendant
;
18
22
public
function
getDescendant
(): ?
Location
23
{
24
return
$this->descendant
;
25
}
26
31
public
function
setDescendant
(
Location
$descendant
): self
32
{
33
$this->descendant =
$descendant
;
34
return
$this;
35
}
36
43
public
function
isContain
(
Location
$location
): bool
44
{
45
foreach
($this->items as $item)
46
{
47
if
($item->isEqualTo(
$location
))
48
{
49
return
true
;
50
}
51
}
52
53
return
false
;
54
}
55
62
public
function
isEqualTo(
Parents
$parents): bool
63
{
64
if
($this->
count
() !== $parents->
count
())
65
{
66
return
false
;
67
}
68
73
foreach
($this as $idx => $item)
74
{
75
if
(!$item->isEqualTo($parents[$idx]))
76
{
77
return
false
;
78
}
79
}
80
81
return
true
;
82
}
83
90
public
function
getItemByType
(
int
$type
):?
Location
91
{
92
foreach
($this->items as $item)
93
{
94
if
($item->getType() ===
$type
)
95
{
96
return
$item;
97
}
98
}
99
100
return
null
;
101
}
102
}
$type
$type
Определения
options.php:106
Bitrix\Location\Entity\Generic\Collection\count
count()
Определения
collection.php:88
Bitrix\Location\Entity\Location\Collection
Определения
collection.php:15
Bitrix\Location\Entity\Location\Parents
Определения
parents.php:13
Bitrix\Location\Entity\Location\Parents\$descendant
$descendant
Определения
parents.php:17
Bitrix\Location\Entity\Location\Parents\getItemByType
getItemByType(int $type)
Определения
parents.php:90
Bitrix\Location\Entity\Location\Parents\$items
$items
Определения
parents.php:15
Bitrix\Location\Entity\Location\Parents\setDescendant
setDescendant(Location $descendant)
Определения
parents.php:31
Bitrix\Location\Entity\Location\Parents\getDescendant
getDescendant()
Определения
parents.php:22
Bitrix\Location\Entity\Location\Parents\isContain
isContain(Location $location)
Определения
parents.php:43
Bitrix\Location\Entity\Location
Определения
collection.php:3
$location
$location
Определения
options.php:2729
bitrix
modules
location
lib
entity
location
parents.php
Создано системой
1.14.0