10abstract class Immutable implements \Iterator, \Countable
17 protected function appendItem(Item $item, $throwException =
true)
19 if ($this->
ensureItem($item, $throwException)) {
20 $this->items[] = $item;
28 foreach ($collection as $item) {
33 public function ensureItem(Item $item, $throwException =
true)
35 if ($throwException) {
37 throw new \Bitrix\Main\SystemException(
'unsupported item');
46 foreach ($data as $item) {
58 $collection =
new static();
59 foreach ($array as $row) {
60 if ($item = $collection->createItem($row)) {
61 $collection->appendItem($item);
111 return isset($this->items[$this->position]);
128 return count($this->items);
ensureItem(Item $item, $throwException=true)
__construct(array $data=[])
appendCollection(Immutable $collection, $throwException=true)
appendItem(Item $item, $throwException=true)
static fromArray(array $array)