Skip to content

Commit

Permalink
Merge pull request #97 from intexsys/fixed-array-undefined-resource-type
Browse files Browse the repository at this point in the history
Fixed "Undefined index: @type" for resource non-empty array fields
  • Loading branch information
nilportugues authored Jul 19, 2018
2 parents fd86f75 + 789fa12 commit 72684da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Helpers/DataIncludedHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ protected static function removeResourcesNotIncluded(array &$mappings, $parentTy
*/
protected static function isDeleteableIncludedResource(array &$mappings, $parentType, $includeValue)
{
if (!isset($includeValue[Serializer::CLASS_IDENTIFIER_KEY])) {
return true;
}

return !empty($mappings[$parentType])
&& count($mappings[$parentType]->getIncludedResources()) > 0
&& false === in_array($includeValue[Serializer::CLASS_IDENTIFIER_KEY], $mappings[$parentType]->getIncludedResources(), true);
Expand Down

0 comments on commit 72684da

Please sign in to comment.