@@ 122-131 (lines=10) @@ | ||
119 | * @param array $meta optional, if given a LinkObject is added, otherwise a link string is added |
|
120 | * @param string $level one of the Document::LEVEL_* constants, optional, defaults to Document::LEVEL_ROOT |
|
121 | */ |
|
122 | public function addLink($key, $href, array $meta=[], $level=Document::LEVEL_ROOT) { |
|
123 | $this->ensureResourceObject(); |
|
124 | ||
125 | if ($level === Document::LEVEL_RESOURCE) { |
|
126 | $this->resource->addLink($key, $href, $meta); |
|
127 | } |
|
128 | else { |
|
129 | parent::addLink($key, $href, $meta, $level); |
|
130 | } |
|
131 | } |
|
132 | ||
133 | /** |
|
134 | * set the self link on the resource |
|
@@ 139-148 (lines=10) @@ | ||
136 | * @param string $href |
|
137 | * @param array $meta optional |
|
138 | */ |
|
139 | public function setSelfLink($href, array $meta=[], $level=Document::LEVEL_RESOURCE) { |
|
140 | $this->ensureResourceObject(); |
|
141 | ||
142 | if ($level === Document::LEVEL_RESOURCE) { |
|
143 | $this->resource->setSelfLink($href, $meta); |
|
144 | } |
|
145 | else { |
|
146 | parent::setSelfLink($href, $meta, $level); |
|
147 | } |
|
148 | } |
|
149 | ||
150 | /** |
|
151 | * @param string $key |