src/Server/Data/DataAssertions.php 1 location
|
@@ 85-88 (lines=4) @@
|
| 82 |
|
) { |
| 83 |
|
$mapping = $serializer->getTransformer()->getMappingByAlias($data[JsonApiTransformer::TYPE_KEY]); |
| 84 |
|
|
| 85 |
|
if (null === $mapping || $mapping->getClassName() !== $className) { |
| 86 |
|
$errorBag->offsetSet(null, new InvalidTypeError($data[JsonApiTransformer::TYPE_KEY])); |
| 87 |
|
throw new DataException(); |
| 88 |
|
} |
| 89 |
|
} |
| 90 |
|
|
| 91 |
|
/** |
src/Server/Data/DataObject.php 1 location
|
@@ 174-181 (lines=8) @@
|
| 171 |
|
} |
| 172 |
|
|
| 173 |
|
//Provided type value is supported. |
| 174 |
|
if (null === $serializer->getTransformer()->getMappingByAlias( |
| 175 |
|
$relationshipData[JsonApiTransformer::TYPE_KEY] |
| 176 |
|
) |
| 177 |
|
) { |
| 178 |
|
$errorBag->offsetSet(null, new InvalidTypeError($relationshipData[JsonApiTransformer::TYPE_KEY])); |
| 179 |
|
|
| 180 |
|
return; |
| 181 |
|
} |
| 182 |
|
|
| 183 |
|
//Validate if attributes passed in make sense. |
| 184 |
|
if (!empty($relationshipData[JsonApiTransformer::ATTRIBUTES_KEY])) { |