| 1 | <?php |
||
| 7 | final class RouteManager |
||
| 8 | { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @var array|Route[] |
||
| 12 | */ |
||
| 13 | private $routes; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var \DoliDB |
||
| 17 | */ |
||
| 18 | private $db; |
||
| 19 | |||
| 20 | public function __construct(\DoliDB $db) |
||
| 25 | |||
| 26 | |||
| 27 | /** |
||
| 28 | * @param Route $route |
||
| 29 | * |
||
| 30 | * @throws \Exception |
||
| 31 | */ |
||
| 32 | public function add(Route $route){ |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param array $routes |
||
| 42 | * |
||
| 43 | * @throws \Exception |
||
| 44 | */ |
||
| 45 | public function load(array $routes){ |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $name |
||
| 53 | * |
||
| 54 | * @throws \Exception |
||
| 55 | */ |
||
| 56 | public function __invoke($name) |
||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | } |