@@ 215-229 (lines=15) @@ | ||
212 | /** |
|
213 | * @inheritDoc |
|
214 | */ |
|
215 | public function toArray() { |
|
216 | $array = $this->getAtMembers(); |
|
217 | ||
218 | if ($this->jsonapi !== null && $this->jsonapi->isEmpty() === false) { |
|
219 | $array['jsonapi'] = $this->jsonapi->toArray(); |
|
220 | } |
|
221 | if ($this->links !== null && $this->links->isEmpty() === false) { |
|
222 | $array['links'] = $this->links->toArray(); |
|
223 | } |
|
224 | if ($this->meta !== null && $this->meta->isEmpty() === false) { |
|
225 | $array['meta'] = $this->meta->toArray(); |
|
226 | } |
|
227 | ||
228 | return $array; |
|
229 | } |
|
230 | ||
231 | /** |
|
232 | * @inheritDoc |
@@ 237-251 (lines=15) @@ | ||
234 | /** |
|
235 | * @inheritDoc |
|
236 | */ |
|
237 | public function toArray() { |
|
238 | $array = parent::toArray(); |
|
239 | ||
240 | if ($this->attributes !== null && $this->attributes->isEmpty() === false) { |
|
241 | $array['attributes'] = $this->attributes->toArray(); |
|
242 | } |
|
243 | if ($this->relationships !== null && $this->relationships->isEmpty() === false) { |
|
244 | $array['relationships'] = $this->relationships->toArray(); |
|
245 | } |
|
246 | if ($this->links !== null && $this->links->isEmpty() === false) { |
|
247 | $array['links'] = $this->links->toArray(); |
|
248 | } |
|
249 | ||
250 | return $array; |
|
251 | } |
|
252 | ||
253 | /** |
|
254 | * RecursiveResourceContainerInterface |