1 | <?php namespace Neomerx\JsonApi\Document; |
||
27 | class Link implements LinkInterface |
||
28 | { |
||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $subHref; |
||
33 | |||
34 | /** |
||
35 | * @var mixed|null |
||
36 | */ |
||
37 | private $meta; |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | private $treatAsHref; |
||
43 | |||
44 | /** |
||
45 | * @param string $subHref |
||
46 | * @param mixed|null $meta |
||
47 | * @param bool $treatAsHref If $subHref is a full URL and must not be concatenated with other URLs. |
||
48 | * |
||
49 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
50 | */ |
||
51 | 86 | public function __construct(string $subHref, $meta = null, bool $treatAsHref = false) |
|
57 | |||
58 | /** |
||
59 | * @inheritdoc |
||
60 | */ |
||
61 | 71 | public function getSubHref(): string |
|
65 | |||
66 | /** |
||
67 | * @inheritdoc |
||
68 | */ |
||
69 | 71 | public function getMeta() |
|
73 | |||
74 | /** |
||
75 | * @inheritdoc |
||
76 | */ |
||
77 | 71 | public function isTreatAsHref(): bool |
|
81 | |||
82 | /** |
||
83 | * @inheritdoc |
||
84 | */ |
||
85 | 71 | public function hasMeta(): bool |
|
89 | |||
90 | /** |
||
91 | * @inheritdoc |
||
92 | */ |
||
93 | 71 | public function getHref(string $prefix = null): string |
|
97 | |||
98 | /** |
||
99 | * @inheritdoc |
||
100 | */ |
||
101 | 1 | public function getHrefWithMeta(string $prefix = null): array |
|
108 | } |
||
109 |