1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
fieldcollection.php
См. документацию.
1<?php
2
3namespace Bitrix\Location\Entity\Format;
4
5use Bitrix\Main\ArgumentTypeException;
6use Bitrix\Main\SystemException;
7
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}
$result
Определения get_property_values.php:14
else $a
Определения template.php:137