src/Serializer/JsonApiSerializer.php
protected function pullOutNestedIncludedData(array $data)
    {
        $includedData = [];
        $linkedIds = [];

        foreach ($data as $value) {
            foreach ($value as $includeObject) {
                if (isset($includeObject['included'])) {
                    list($includedData, $linkedIds) = $this->serializeIncludedObjectsWithCacheKey($includeObject['included'], $linkedIds, $includedData);
                }
            }
        }

        return [$includedData, $linkedIds];
    }
protected function pullOutNestedIncludedData(array $data)
    {
        $includedData = [];
        $linkedIds = [];

        foreach ($data as $value) {
            foreach ($value as $includeObject) {
                if (isset($includeObject['included'])) {
                    list($includedData, $linkedIds) = $this->serializeIncludedObjectsWithCacheKey($includeObject['included'], $linkedIds, $includedData);
                }
            }
        }

        return [$includedData, $linkedIds];
    }
protected function pullOutNestedIncludedData ( array $ data ) { $ includedData = [ ] ; $ linkedIds = [ ] ; foreach ( $ data as $ value ) { foreach ( $ value as $ includeObject ) { if ( isset ( $ includeObject [ 'included' ] ) ) { list ( $ includedData , $ linkedIds ) = $ this -> serializeIncludedObjectsWithCacheKey ( $ includeObject [ 'included' ] , $ linkedIds , $ includedData ) ; } } } return [ $ includedData , $ linkedIds ] ; }
Keep all sideloaded inclusion data on the top level.

@param array $data

@return array
Keep all sideloaded inclusion data on the top level .