1 | <?php |
||
15 | abstract class AbstractFactory implements FactoryInterface |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | private $name; |
||
22 | |||
23 | /** |
||
24 | * @param string $name |
||
25 | */ |
||
26 | 44 | public function __construct($name) |
|
30 | |||
31 | /** |
||
32 | * @return string |
||
33 | */ |
||
34 | abstract public function getServiceType(); |
||
35 | |||
36 | /** |
||
37 | * @param ContainerInterface $container |
||
38 | * @param array|ArrayObject|ZendArrayObject $config |
||
39 | */ |
||
40 | abstract protected function create(ContainerInterface $container, $config); |
||
41 | |||
42 | /** |
||
43 | * @param ServiceLocatorInterface $serviceLocator |
||
44 | * @return mixed |
||
45 | * @throws ServiceNotCreatedException |
||
46 | */ |
||
47 | 43 | public function createService(ServiceLocatorInterface $serviceLocator) |
|
51 | |||
52 | /** |
||
53 | * @param ContainerInterface $container |
||
54 | * @return mixed |
||
55 | * @throws ServiceNotCreatedException |
||
56 | */ |
||
57 | 44 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
68 | |||
69 | /** |
||
70 | * @param ContainerInterface $container |
||
71 | * @param string $serviceOrClass |
||
72 | * @return mixed |
||
73 | */ |
||
74 | 35 | protected function getServiceOrClassObject(ContainerInterface $container, $serviceOrClass) |
|
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | */ |
||
87 | 24 | protected function getName() |
|
91 | } |
||
92 |