protected function data(ServerRequestInterface $request, Document $document)
    {
        $postId = array_get($request->getQueryParams(), 'post');
        $actor = $request->getAttribute('actor');
        $file = array_get($request->getUploadedFiles(), 'image');

        return $this->bus->dispatch(
            new UploadImage($postId, $file, $actor)
        );
    }
protected function data(ServerRequestInterface $request, Document $document)
    {
        $postId = array_get($request->getQueryParams(), 'post');
        $actor = $request->getAttribute('actor');
        $file = array_get($request->getUploadedFiles(), 'image');

        return $this->bus->dispatch(
            new UploadImage($postId, $file, $actor)
        );
    }
protected function data ( ServerRequestInterface $ request , Document $ document ) { $ postId = array_get ( $ request -> getQueryParams ( ) , 'post' ) ; $ actor = $ request -> getAttribute ( 'actor' ) ; $ file = array_get ( $ request -> getUploadedFiles ( ) , 'image' ) ; return $ this -> bus -> dispatch ( new UploadImage ( $ postId , $ file , $ actor ) ) ; }
Get the data to be serialized and assigned to the response document.

@param ServerRequestInterface $request
@param Document               $document
@return mixed
Get the data to be serialized and assigned to the response document .