ILIAS  release_7 Revision v7.30-3-g800a261c036
MetaDataCollection.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Iterator;
24
30{
34 protected $items = [];
35
36 public function add(MetaDatum $meta_datum) : void
37 {
38 $this->items[] = $meta_datum;
39 }
40
41 public function clear() : void
42 {
43 $this->items = [];
44 }
45
49 public function getItems() : Iterator
50 {
51 yield from $this->items;
52 }
53
57 public function getItemsAsKeyValuePairs() : array
58 {
59 $key_value_pairs = [];
60 array_walk($this->items, function (MetaDatum $d) use (&$key_value_pairs) : void {
61 $key_value_pairs[$d->getKey()] = $d->getValue();
62 });
63 return $key_value_pairs;
64 }
65}
An exception for terminatinating execution or to throw for unit testing.
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296