PHP Class eZ\Publish\Core\REST\Common\Output\Visitor

Datei anzeigen Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$generator Generator Generator.
$response Symfony\Component\HttpFoundation\Response HTTP Response Object.
$valueObjectVisitorDispatcher ValueObjectVisitorDispatcher

Public Methods

Method Description
__construct ( Generator $generator, ValueObjectVisitorDispatcher $valueObjectVisitorDispatcher ) Construct from Generator and an array of concrete view model visitors.
getMediaType ( string $type ) : string Generates a media type for $type based on the used generator.
getResponse ( ) : Response
setHeader ( string $name, string $value ) Set HTTP response header.
setStatus ( integer $statusCode ) Sets the given status code in the corresponding header.
visit ( mixed $data ) : Response Visit struct returned by controllers.
visitValueObject ( object $data ) : mixed Visit struct returned by controllers.

Method Details

__construct() public method

Construct from Generator and an array of concrete view model visitors.
public __construct ( Generator $generator, ValueObjectVisitorDispatcher $valueObjectVisitorDispatcher )
$generator Generator
$valueObjectVisitorDispatcher ValueObjectVisitorDispatcher

getMediaType() public method

Generates a media type for $type based on the used generator.
See also: eZ\Publish\Core\REST\Common\Generator::getMediaType()
public getMediaType ( string $type ) : string
$type string
return string

getResponse() public method

public getResponse ( ) : Response
return Symfony\Component\HttpFoundation\Response

setHeader() public method

Does not allow overwriting of response headers. The first definition of a header will be used.
public setHeader ( string $name, string $value )
$name string
$value string

setStatus() public method

Note that headers are generally not overwritten!
public setStatus ( integer $statusCode )
$statusCode integer

visit() public method

Visit struct returned by controllers.
public visit ( mixed $data ) : Response
$data mixed
return Symfony\Component\HttpFoundation\Response

visitValueObject() public method

Can be called by sub-visitors to visit nested objects.
public visitValueObject ( object $data ) : mixed
$data object
return mixed

Property Details

$generator protected_oe property

Generator.
protected Generator,eZ\Publish\Core\REST\Common\Output $generator
return Generator

$response protected_oe property

HTTP Response Object.
protected Response,Symfony\Component\HttpFoundation $response
return Symfony\Component\HttpFoundation\Response

$valueObjectVisitorDispatcher protected_oe property

protected ValueObjectVisitorDispatcher,eZ\Publish\Core\REST\Common\Output $valueObjectVisitorDispatcher
return ValueObjectVisitorDispatcher