1: <?php
2:
3: namespace PHPixie\Auth;
4:
5: class Repositories
6: {
7: protected $repositoryRegistry;
8:
9: public function __construct($repositoryRegistry = null)
10: {
11: $this->repositoryRegistry = $repositoryRegistry;
12: }
13:
14: public function get($name)
15: {
16: if($this->repositoryRegistry !== null) {
17: $repository = $this->repositoryRegistry->repository($name);
18: if($repository !== null) {
19: return $repository;
20: }
21: }
22:
23: throw new \PHPixie\Auth\Exception("Repository '$name' does not exist");
24: }
25: }