1 | <?php |
||
29 | class AbstractClassRegistry implements SingletonInterface |
||
30 | { |
||
31 | /** |
||
32 | * Holds the mapping key => className |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $classMap = []; |
||
36 | |||
37 | /** |
||
38 | * Name for the default implementation |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $defaultClass = \stdClass::class; |
||
43 | |||
44 | /** |
||
45 | * @var ObjectManagerInterface |
||
46 | */ |
||
47 | protected $objectManager; |
||
48 | |||
49 | /** |
||
50 | * @param ObjectManagerInterface $objectManager |
||
51 | */ |
||
52 | public function injectObjectManager(ObjectManagerInterface $objectManager) |
||
56 | |||
57 | /** |
||
58 | * Retrieves an instance for an registered type. |
||
59 | * |
||
60 | * @param string $type |
||
61 | * @return object |
||
62 | */ |
||
63 | public function getInstance($type) |
||
68 | |||
69 | /** |
||
70 | * @param string $type |
||
71 | * @return string |
||
72 | */ |
||
73 | protected function resolveClassName($type) |
||
82 | |||
83 | /** |
||
84 | * Create an instance of a certain class |
||
85 | * |
||
86 | * @param string $className |
||
87 | * @return object |
||
88 | */ |
||
89 | protected function createInstance($className) |
||
93 | |||
94 | /** |
||
95 | * Can be used to register an implementation in the classMap. |
||
96 | * |
||
97 | * @param string $className |
||
98 | * @param string $type |
||
99 | * @param string $requiredBaseClass |
||
100 | */ |
||
101 | protected function register($className, $type, $requiredBaseClass) { |
||
113 | } |
||
114 | |||
115 |