Visitor
Visitor.php
:
15
Visits a value object into an HTTP Response.
Properties¶
$generator
¶
Visitor.php
:
27
Generator.
|
|
|
$response
¶
Visitor.php
:
34
HTTP Response Object.
|
|
|
$valueObjectVisitorDispatcher
¶
Visitor.php
:
20
|
|
|
Methods¶
__construct()
¶
Visitor.php
:
49
Construct from Generator and an array of concrete view model visitors.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $generator | Generator | - | - |
| $valueObjectVisitorDispatcher | ValueObjectVisitorDispatcher | - | - |
getMediaType()
¶
Visitor.php
:
153
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
:
161
|
|
|
Return values
Response
setHeader()
¶
Visitor.php
:
67
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
:
83
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
:
98
Visit struct returned by controllers.
|
|
|
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $data | mixed | - | - |
Return values
Response
visitValueObject()
¶
Visitor.php
:
136
Visit struct returned by controllers.
|
|
|
Can be called by sub-visitors to visit nested objects.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| $data | object | - | - |