ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
MetaDataCollection.php
Go to the documentation of this file.
2
7
14{
18 protected $items = [];
19
20 public function add(MetaDatum $meta_datum) : void
21 {
22 $this->items[] = $meta_datum;
23 }
24
25 public function clear()
26 {
27 $this->items = [];
28 }
29
33 public function getItems() : \Iterator
34 {
35 yield from $this->items;
36 }
37
41 public function getItemsAsKeyValuePairs() : array
42 {
43 $key_value_pairs = [];
44 array_walk($this->items, function (MetaDatum $d) use (&$key_value_pairs) {
45 $key_value_pairs[$d->getKey()] = $d->getValue();
46 });
47 return $key_value_pairs;
48 }
49}
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