1 | <?php |
||
24 | class RepositoryManager implements RepositoryManagerInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | private $types; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | private $repositories; |
||
35 | |||
36 | 5 | public function __construct() |
|
41 | |||
42 | 5 | public function addType($indexTypeName, FinderInterface $finder, $repositoryName = null) |
|
49 | |||
50 | /** |
||
51 | * Return repository for entity. |
||
52 | * |
||
53 | * Returns custom repository if one specified otherwise |
||
54 | * returns a basic repository. |
||
55 | * |
||
56 | * @param string $typeName |
||
57 | * |
||
58 | * @return Repository |
||
59 | */ |
||
60 | 5 | public function getRepository($typeName) |
|
75 | |||
76 | /** |
||
77 | * Checks if repository exists for type |
||
78 | * |
||
79 | * @param $typeName |
||
80 | * @return bool |
||
81 | */ |
||
82 | 5 | public function hasRepository($typeName): bool |
|
86 | |||
87 | /** |
||
88 | * @param $typeName |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | 4 | protected function getRepositoryName($typeName) |
|
100 | |||
101 | /** |
||
102 | * @param $typeName |
||
103 | * |
||
104 | * @return mixed |
||
105 | */ |
||
106 | 4 | private function createRepository($typeName) |
|
114 | } |
||
115 |