| 1 | <?php |
||
| 11 | class Registry |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Admins registry. |
||
| 15 | * |
||
| 16 | * @var AdminInterface[] |
||
| 17 | */ |
||
| 18 | protected $admins = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Add an Admin to the registry. |
||
| 22 | * |
||
| 23 | * @param AdminInterface $admin |
||
| 24 | * @throws Exception |
||
| 25 | */ |
||
| 26 | 3 | public function add(AdminInterface $admin) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Return an Admin from the registry. |
||
| 36 | * |
||
| 37 | * @param string $name |
||
| 38 | * @return AdminInterface |
||
| 39 | * @throws Exception |
||
| 40 | */ |
||
| 41 | 3 | public function get($name) |
|
| 49 | |||
| 50 | /** |
||
| 51 | * Return true if an Admin with the name $name has been registered. |
||
| 52 | * |
||
| 53 | * @param string $name |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | public function has($name) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Return all the registered Admins. |
||
| 63 | * |
||
| 64 | * @return AdminInterface[] |
||
| 65 | */ |
||
| 66 | 1 | public function all() |
|
| 70 | } |
||
| 71 |