1 | <?php |
||
22 | class Definition |
||
23 | { |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $class; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $abstract; |
||
33 | |||
34 | /** |
||
35 | * @var Argument |
||
36 | */ |
||
37 | private $argument; |
||
38 | |||
39 | /** |
||
40 | * @var Property |
||
41 | */ |
||
42 | private $property; |
||
43 | |||
44 | /** |
||
45 | * @var MethodCall |
||
46 | */ |
||
47 | private $call; |
||
48 | |||
49 | /** |
||
50 | * @var bool |
||
51 | */ |
||
52 | private $shared = false; |
||
53 | |||
54 | /** |
||
55 | * @var array |
||
56 | */ |
||
57 | private $tags = array(); |
||
58 | |||
59 | /** |
||
60 | * Constructor. |
||
61 | * |
||
62 | * @param string $class |
||
63 | * @param array $arguments |
||
64 | */ |
||
65 | public function __construct($class, array $arguments = array()) |
||
72 | |||
73 | /** |
||
74 | * Get class. |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getClass() |
||
82 | |||
83 | /** |
||
84 | * Get abstract class. |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getAbstract() |
||
92 | |||
93 | /** |
||
94 | * Set abstract class. |
||
95 | * |
||
96 | * @param string $abstract |
||
97 | * |
||
98 | * @return static |
||
99 | */ |
||
100 | public function setAbstract($abstract) |
||
106 | |||
107 | /** |
||
108 | * Check if definition is abstract. |
||
109 | * |
||
110 | * @return bool |
||
111 | */ |
||
112 | public function isAbstract() |
||
116 | |||
117 | /** |
||
118 | * Get property. |
||
119 | * |
||
120 | * @return Property |
||
121 | */ |
||
122 | public function getProperty() |
||
126 | |||
127 | /** |
||
128 | * Shortcut set property. |
||
129 | * |
||
130 | * @param string $property |
||
131 | * @param mixed $value |
||
132 | * |
||
133 | * @return static |
||
134 | */ |
||
135 | public function setProperty($property, $value) |
||
141 | |||
142 | /** |
||
143 | * Ger argument. |
||
144 | * |
||
145 | * @return Argument |
||
146 | */ |
||
147 | public function getArgument() |
||
151 | |||
152 | /** |
||
153 | * Shortcut add argument. |
||
154 | * |
||
155 | * @param mixed $argument |
||
156 | * |
||
157 | * @return static |
||
158 | */ |
||
159 | public function addArgument($argument) |
||
165 | |||
166 | /** |
||
167 | * Get method call. |
||
168 | * |
||
169 | * @return MethodCall |
||
170 | */ |
||
171 | public function getMethodCall() |
||
175 | |||
176 | /** |
||
177 | * Shortcut add method call. |
||
178 | * |
||
179 | * @param string $method |
||
180 | * @param array $arguments |
||
181 | * |
||
182 | * @return static |
||
183 | */ |
||
184 | public function addMethodCall($method, array $arguments = array()) |
||
190 | |||
191 | /** |
||
192 | * Mark this definition as singleton. |
||
193 | * |
||
194 | * @return static |
||
195 | */ |
||
196 | public function share() |
||
202 | |||
203 | /** |
||
204 | * Check if definition shared. |
||
205 | * |
||
206 | * @return bool |
||
207 | */ |
||
208 | public function isShared() |
||
212 | |||
213 | /** |
||
214 | * Add a tag. |
||
215 | * |
||
216 | * @param string $name |
||
217 | * @param array $attributes |
||
218 | */ |
||
219 | public function addTag($name, array $attributes = array()) |
||
231 | |||
232 | /** |
||
233 | * Get all tags. |
||
234 | * |
||
235 | * @return array |
||
236 | */ |
||
237 | public function getTags() |
||
241 | } |
||
242 |