Visitor
Visitor.php
:
14
Visits a value object into an HTTP Response.
Properties¶
$generator¶
Visitor.php
:
26
Generator.
|
|
$response¶
Visitor.php
:
33
HTTP Response Object.
|
|
$valueObjectVisitorDispatcher¶
Visitor.php
:
19
|
|
Methods¶
__construct() ¶
Visitor.php
:
48
Construct from Generator and an array of concrete view model visitors.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$generator | Generator | - | - |
$valueObjectVisitorDispatcher | ValueObjectVisitorDispatcher | - | - |
getMediaType() ¶
Visitor.php
:
148
Generates a media type for $type based on the used generator.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$type | string | - | - |
Return values
string
getResponse() ¶
Visitor.php
:
156
|
|
Return values
Response
setHeader() ¶
Visitor.php
:
64
Set HTTP response header.
|
|
Does not allow overwriting of response headers. The first definition of a header will be used.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$name | string | - | - |
$value | string | - | - |
setStatus() ¶
Visitor.php
:
78
Sets the given status code in the corresponding header.
|
|
Note that headers are generally not overwritten!
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$statusCode | int | - | - |
visit() ¶
Visitor.php
:
93
Visit struct returned by controllers.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$data | mixed | - | - |
Return values
Response
visitValueObject() ¶
Visitor.php
:
131
Visit struct returned by controllers.
|
|
Can be called by sub-visitors to visit nested objects.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$data | object | - | - |