1 | <?php |
||
26 | class EndpointsContainer |
||
27 | { |
||
28 | /** |
||
29 | * @var Request |
||
30 | */ |
||
31 | protected $request; |
||
32 | |||
33 | /** |
||
34 | * Array with the cached endpoints |
||
35 | * @var Endpoint[] |
||
36 | */ |
||
37 | protected $endpoints = []; |
||
38 | |||
39 | public function __construct(Request $request) |
||
43 | |||
44 | /** |
||
45 | * @param string $endpoint |
||
46 | * @return Endpoint |
||
47 | */ |
||
48 | public function __get($endpoint) |
||
52 | |||
53 | /** |
||
54 | * @param string $endpoint |
||
55 | * @return Endpoint |
||
56 | * @throws WrongEndPointException |
||
57 | */ |
||
58 | public function getEndpoint($endpoint) |
||
66 | |||
67 | /** |
||
68 | * @param string $endpoint |
||
69 | * @throws WrongEndPointException |
||
70 | */ |
||
71 | protected function addEndpoint($endpoint) |
||
80 | |||
81 | /** |
||
82 | * @param string $class |
||
83 | * @return Endpoint|object |
||
84 | * @throws WrongEndPointException |
||
85 | */ |
||
86 | protected function createEndpoint($class) |
||
95 | |||
96 | /** |
||
97 | * @return Request |
||
98 | */ |
||
99 | public function getRequest() |
||
103 | } |