1 | <?php |
||
17 | class Property |
||
18 | { |
||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $properties = array(); |
||
23 | |||
24 | /** |
||
25 | * Constructor. |
||
26 | * |
||
27 | * @param array $properties |
||
28 | */ |
||
29 | public function __construct(array $properties = array()) |
||
33 | |||
34 | /** |
||
35 | * Clear and replace with sets of properties. |
||
36 | * |
||
37 | * @param array $properties |
||
38 | * |
||
39 | * @return Property |
||
40 | */ |
||
41 | public function replace(array $properties) |
||
47 | |||
48 | /** |
||
49 | * Add parameter. |
||
50 | * |
||
51 | * @param array $properties |
||
52 | * |
||
53 | * @return static |
||
54 | */ |
||
55 | public function add(array $properties) |
||
63 | |||
64 | /** |
||
65 | * Set property. |
||
66 | * |
||
67 | * @param string $name |
||
68 | * @param mixed $value |
||
69 | * |
||
70 | * @return static |
||
71 | */ |
||
72 | public function set($name, $value) |
||
78 | |||
79 | /** |
||
80 | * Get property value. |
||
81 | * |
||
82 | * @param string $name |
||
83 | * |
||
84 | * @return mixed|null |
||
85 | */ |
||
86 | public function get($name) |
||
94 | |||
95 | /** |
||
96 | * Check if has property with specified name. |
||
97 | * |
||
98 | * @param string $name |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | public function has($name) |
||
106 | |||
107 | /** |
||
108 | * Get all properties. |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | public function all() |
||
116 | } |
||
117 |