Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
itemcollection.php
1<?php
2
3
5
6
8{
9 protected $collection;
11
12 public function addItem(Item $item)
13 {
14 $index = $item->getInternalIndex() == '' ? 'n'.static::$internalIndex++ : $item->getInternalIndex();
15
16 $this->collection[$index] = $item;
17 }
18
19 public function toArray()
20 {
21 $result = [];
22 if(count($this->collection)>0)
23 {
27 foreach ($this->collection as $index=>$item)
28 {
29 $result[$index] = $item->getCmd()->build();
30 }
31 }
32 return $result;
33 }
34
35 public function toArrayRaw()
36 {
37 $result = [];
38 if(count($this->collection)>0)
39 {
43 foreach ($this->collection as $index=>$item)
44 {
45 $result[$index] = $item->getCmd()->getFieldsValues();
46 }
47 }
48 return $result;
49 }
50}