1 | <?php |
||
33 | class Factory extends ObjectAbstract implements FactoryInterface |
||
34 | { |
||
35 | use FactoryHelperTrait; |
||
36 | |||
37 | /** |
||
38 | * @param ResolverInterface |
||
39 | * @access public |
||
40 | */ |
||
41 | public function __construct(ResolverInterface $resolver) |
||
42 | { |
||
43 | $this->setResolver($resolver); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * {@inheritDoc} |
||
48 | */ |
||
49 | public function createInstance(/*# string */ $rawId, array $arguments) |
||
69 | |||
70 | /** |
||
71 | * {@inheritDoc} |
||
72 | */ |
||
73 | public function executeCallable($callable, array $arguments = []) |
||
88 | |||
89 | /** |
||
90 | * {@inheritDoc} |
||
91 | */ |
||
92 | public function executeMethodBatch(array $methods, $object = null) |
||
98 | |||
99 | /** |
||
100 | * if $object provided, build callable like [$object, $method] and execute it. |
||
101 | * |
||
102 | * method: |
||
103 | * |
||
104 | * - callable |
||
105 | * |
||
106 | * - array ['function', [ arguments...]] |
||
107 | * |
||
108 | * - array [callable, [ arguments ...]] |
||
109 | * |
||
110 | * - array ['method', [ arguments ...]] |
||
111 | * will be converted to [[$object, 'method'], [ ... ]] |
||
112 | * |
||
113 | * @param array|callable method |
||
114 | * @param object|null $object to construct callable |
||
115 | * @throws LogicException if something goes wrong |
||
116 | * @access protected |
||
117 | */ |
||
118 | protected function executeMethod($method, $object = null) |
||
132 | |||
133 | /** |
||
134 | * Things to do after an object created. |
||
135 | * |
||
136 | * @param object $object |
||
137 | * @param array $definition service definition for $object |
||
138 | * @access protected |
||
139 | */ |
||
140 | protected function afterCreation($object, array $definition) |
||
152 | |||
153 | /** |
||
154 | * Execute common methods for all objects |
||
155 | * |
||
156 | * @param object $object |
||
157 | * @access protected |
||
158 | */ |
||
159 | protected function executeCommonBatch($object) |
||
170 | } |
||
171 |