src/Transformer/Helpers/RecursiveFilterHelper.php
public static function deletePropertiesNotInFilter(array &$mappings, array &$array, string $typeKey)
    {
        if (\array_key_exists(Serializer::CLASS_IDENTIFIER_KEY, $array)) {
            $newArray = [];
            $type = $array[Serializer::CLASS_IDENTIFIER_KEY];

            self::deleteMatchedClassNotInFilterProperties($mappings, $array, $typeKey, $type, $newArray);

            if (!empty($newArray)) {
                $array = $newArray;
            }
        }
    }
public static function deletePropertiesNotInFilter(array &$mappings, array &$array, string $typeKey)
    {
        if (\array_key_exists(Serializer::CLASS_IDENTIFIER_KEY, $array)) {
            $newArray = [];
            $type = $array[Serializer::CLASS_IDENTIFIER_KEY];

            self::deleteMatchedClassNotInFilterProperties($mappings, $array, $typeKey, $type, $newArray);

            if (!empty($newArray)) {
                $array = $newArray;
            }
        }
    }
public static function deletePropertiesNotInFilter ( array & $ mappings , array & $ array , string $ typeKey ) { if ( \ array_key_exists ( Serializer :: CLASS_IDENTIFIER_KEY , $ array ) ) { $ newArray = [ ] ; $ type = $ array [ Serializer :: CLASS_IDENTIFIER_KEY ] ; self :: deleteMatchedClassNotInFilterProperties ( $ mappings , $ array , $ typeKey , $ type , $ newArray ) ; if ( ! empty ( $ newArray ) ) { $ array = $ newArray ; } } }
Delete all keys except the ones considered identifier keys or defined in the filter.

@param \NilPortugues\Api\Mapping\Mapping[] $mappings
@param array                               $array
@param string                              $typeKey
Delete all keys except the ones considered identifier keys or defined in the filter .