DefaultRequestSerializer
in package
implements
RequestSerializerInterface
Default request serializer that transforms command options and operation parameters into a request
Table of Contents
Interfaces
- RequestSerializerInterface
- Translates command options and operation parameters into a request object
Properties
- $factory : VisitorFlyweight
- $instance : self
Methods
- __construct() : mixed
- addVisitor() : self
- Add a location visitor to the serializer
- getInstance() : self
- prepare() : RequestInterface
- Create a request for a command
- createRequest() : RequestInterface
- Create a request for the command and operation
- prepareAdditionalParameters() : null|RequestVisitorInterface
- Serialize additional parameters
Properties
$factory
protected
VisitorFlyweight
$factory
Visitor factory
$instance
protected
static self
$instance
Methods
__construct()
public
__construct(VisitorFlyweight $factory) : mixed
Parameters
- $factory : VisitorFlyweight
-
Factory to use when creating visitors
addVisitor()
Add a location visitor to the serializer
public
addVisitor(string $location, RequestVisitorInterface $visitor) : self
Parameters
- $location : string
-
Location to associate with the visitor
- $visitor : RequestVisitorInterface
-
Visitor to attach
Return values
selfgetInstance()
public
static getInstance() : self
Tags
Return values
selfprepare()
Create a request for a command
public
prepare(CommandInterface $command) : RequestInterface
Parameters
- $command : CommandInterface
-
Command that will own the request
Return values
RequestInterfacecreateRequest()
Create a request for the command and operation
protected
createRequest(CommandInterface $command) : RequestInterface
Parameters
- $command : CommandInterface
-
Command to create a request for
Return values
RequestInterfaceprepareAdditionalParameters()
Serialize additional parameters
protected
prepareAdditionalParameters(OperationInterface $operation, CommandInterface $command, RequestInterface $request, Parameter $additional) : null|RequestVisitorInterface
Parameters
- $operation : OperationInterface
-
Operation that owns the command
- $command : CommandInterface
-
Command to prepare
- $request : RequestInterface
-
Request to serialize
- $additional : Parameter
-
Additional parameters