1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
fieldcollection.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Location\Entity\Format;
4
5
use Bitrix\Main\ArgumentTypeException;
6
use Bitrix\Main\SystemException;
7
13
final
class
FieldCollection
extends
\Bitrix\Location\Entity\Generic\FieldCollection
14
{
16
protected
$items
= [];
17
24
public
function
addItem
($field): int
25
{
26
if
(!($field instanceof
Field
))
27
{
28
throw
new
ArgumentTypeException
(
'field must be the instance of Field'
);
29
}
30
31
$result
= parent::addItem($field);
32
33
/*
34
* Sort fields due to sort
35
* @todo: what about performance?
36
*/
37
usort(
38
$this->items,
39
function
(
Field
$a
,
Field
$b)
40
{
41
if
(
$a
->getSort() === $b->
getSort
())
42
{
43
return
0;
44
}
45
46
return
(
$a
->getSort() < $b->
getSort
()) ? -1 : 1;
47
}
48
);
49
50
return
$result
;
51
}
52
}
Bitrix\Location\Entity\Format\FieldCollection
Определения
fieldcollection.php:14
Bitrix\Location\Entity\Format\FieldCollection\addItem
addItem($field)
Определения
fieldcollection.php:24
Bitrix\Location\Entity\Format\FieldCollection\$items
$items
Определения
fieldcollection.php:16
Bitrix\Location\Entity\Format\Field
Определения
field.php:13
Bitrix\Location\Entity\Format\Field\getSort
getSort()
Определения
field.php:44
Bitrix\Location\Entity\Generic\FieldCollection
Определения
fieldcollection.php:13
Bitrix\Main\ArgumentTypeException
Определения
ArgumentTypeException.php:9
$result
$result
Определения
get_property_values.php:14
$a
else $a
Определения
template.php:137
bitrix
modules
location
lib
entity
format
fieldcollection.php
Создано системой
1.14.0