1 | <?php |
||
14 | class PropertyBag implements \IteratorAggregate |
||
15 | { |
||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $elements = []; |
||
20 | |||
21 | /** |
||
22 | * Creates a new Property with $name, $value and $params. |
||
23 | * |
||
24 | * @param $name |
||
25 | * @param $value |
||
26 | * @param array $params |
||
27 | * |
||
28 | * @return $this |
||
29 | */ |
||
30 | 35 | public function set($name, $value, $params = []) |
|
36 | |||
37 | /** |
||
38 | * @return Property|null |
||
39 | */ |
||
40 | 7 | public function get(string $name) |
|
48 | |||
49 | /** |
||
50 | * Adds a Property. If Property already exists an Exception will be thrown. |
||
51 | * |
||
52 | * @return $this |
||
53 | * |
||
54 | * @throws \Exception |
||
55 | */ |
||
56 | 37 | public function add(Property $property) |
|
68 | |||
69 | 29 | public function getIterator() |
|
73 | } |
||
74 |