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 | * @deprecated The property bag should not be used as a property factory. Use `$this->add` instead. |
||
25 | * |
||
26 | * @param $name |
||
27 | * @param $value |
||
28 | * @param array $params |
||
29 | * |
||
30 | * @return $this |
||
31 | */ |
||
32 | 4 | public function set($name, $value, $params = []) |
|
36 | |||
37 | /** |
||
38 | * Adds a Property. If Property already exists an Exception will be thrown. |
||
39 | * |
||
40 | * @param Property $property |
||
41 | * |
||
42 | * @return $this |
||
43 | * |
||
44 | * @throws \Exception |
||
45 | */ |
||
46 | 5 | public function add(Property $property) |
|
56 | |||
57 | /** |
||
58 | * @return \ArrayObject |
||
59 | */ |
||
60 | 4 | public function getIterator() |
|
64 | } |
||
65 |