protected function processResourceCollectionDocument($source): ResourceCollectionDocument
    {
        $document = new ResourceCollectionDocument();

        foreach ($source->data as $resourceSrc)
        {
            $document->addResource($this->hydrateResource($resourceSrc));
        }

        $this->hydrateObject($document, $source);

        return $document;
    }
protected function processResourceCollectionDocument($source): ResourceCollectionDocument
    {
        $document = new ResourceCollectionDocument();

        foreach ($source->data as $resourceSrc)
        {
            $document->addResource($this->hydrateResource($resourceSrc));
        }

        $this->hydrateObject($document, $source);

        return $document;
    }
protected function processResourceCollectionDocument ( $ source ) : ResourceCollectionDocument { $ document = new ResourceCollectionDocument ( ) ; foreach ( $ source -> data as $ resourceSrc ) { $ document -> addResource ( $ this -> hydrateResource ( $ resourceSrc ) ) ; } $ this -> hydrateObject ( $ document , $ source ) ; return $ document ; }
Process document with collection of resources

@param  mixed $source
@return ResourceCollectionDocument
Process document with collection of resources