@@ 109-111 (lines=3) @@ | ||
106 | throw NormalizerException::badRequest(sprintf('The "data" member is not valid in the payload for relationship "%s"', $key)); |
|
107 | } |
|
108 | ||
109 | if (true === $relMeta->isOne() && true === $this->isSequentialArray($rel['data'])) { |
|
110 | throw NormalizerException::badRequest(sprintf('The data payload for relationship "%s" is malformed. Data types of "one" must be an associative array, sequential found.', $key)); |
|
111 | } |
|
112 | if (true === $relMeta->isMany() && false === $this->isSequentialArray($rel['data'])) { |
|
113 | throw NormalizerException::badRequest(sprintf('The data payload for relationship "%s" is malformed. Data types of "many" must be a sequential array, associative found.', $key)); |
|
114 | } |
|
@@ 112-114 (lines=3) @@ | ||
109 | if (true === $relMeta->isOne() && true === $this->isSequentialArray($rel['data'])) { |
|
110 | throw NormalizerException::badRequest(sprintf('The data payload for relationship "%s" is malformed. Data types of "one" must be an associative array, sequential found.', $key)); |
|
111 | } |
|
112 | if (true === $relMeta->isMany() && false === $this->isSequentialArray($rel['data'])) { |
|
113 | throw NormalizerException::badRequest(sprintf('The data payload for relationship "%s" is malformed. Data types of "many" must be a sequential array, associative found.', $key)); |
|
114 | } |
|
115 | $flattened[$key] = $rel['data']; |
|
116 | } |
|
117 | return $flattened; |