1 | <?php |
||
9 | class Link implements LinkInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var Explorer |
||
13 | */ |
||
14 | protected $explorer; |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $data; |
||
20 | |||
21 | /** |
||
22 | * @var EmbeddableInterface |
||
23 | */ |
||
24 | protected $parent; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $name; |
||
30 | |||
31 | /** |
||
32 | * @param Explorer $explorer |
||
33 | * @param string $name |
||
34 | * @param array $data |
||
35 | * @param EmbeddableInterface $parent |
||
36 | */ |
||
37 | 5 | public function __construct(Explorer $explorer, $name, array $data, EmbeddableInterface $parent) |
|
38 | 1 | { |
|
39 | 5 | $this->explorer = $explorer; |
|
40 | 5 | $this->data = $data; |
|
41 | 5 | $this->name = $name; |
|
42 | 5 | $this->parent = $parent; |
|
43 | 5 | } |
|
44 | |||
45 | /** |
||
46 | * @param array $variables |
||
47 | * @param array $options |
||
48 | * @return HalResource|ResourceCollection |
||
49 | * @throws AlreadyEmbeddedException |
||
50 | */ |
||
51 | 4 | public function follow(array $variables = [], array $options = []) |
|
64 | |||
65 | /** |
||
66 | * @return array |
||
67 | */ |
||
68 | 5 | public function getData() |
|
72 | |||
73 | /** |
||
74 | * @param array $variables |
||
75 | * @param array $options |
||
76 | * @return HalResource|ResourceCollection |
||
77 | */ |
||
78 | 4 | private function request(array $variables = [], array $options = []) |
|
84 | |||
85 | /** |
||
86 | * @param array $variables |
||
87 | * @return string |
||
88 | */ |
||
89 | 4 | private function getUri(array $variables) |
|
97 | } |
||
98 |