src/Ingewikkeld/Rest/ResourceBundle/Resource/Controller.php
protected function convertResourceToPlainText($format, Resource $resource)
    {
        switch ($format) {
            case 'xml':
                return (string)$resource->getXML()->asXml();
            case 'json':
                return (string)$resource;
            default:
                throw new NotAcceptableHttpException();
        }
    }
protected function convertResourceToPlainText($format, Resource $resource)
    {
        switch ($format) {
            case 'xml':
                return (string)$resource->getXML()->asXml();
            case 'json':
                return (string)$resource;
            default:
                throw new NotAcceptableHttpException();
        }
    }
protected function convertResourceToPlainText ( $ format , Resource $ resource ) { switch ( $ format ) { case 'xml' : return ( string ) $ resource -> getXML ( ) -> asXml ( ) ; case 'json' : return ( string ) $ resource ; default : throw new NotAcceptableHttpException ( ) ; } }
Converts the give HAL Resource to a plain text representation that can be returned in the response.

@param string        $format
@param \Hal\Resource $resource

@throws NotAcceptableHttpException

@return string
Converts the give HAL Resource to a plain text representation that can be returned in the response .