ViewRoomStats
extends StatsAction
in package
Table of Contents
- ACCESS_ID = 'access_id'
- ADDRESS_ID = 'address_id'
- BUILDING_ID = 'building_id'
- FROM_DATE = 'from'
- IMAGE_ID = 'image_id'
- REQUEST_SUBJECT = 'request_subject'
- REQUEST_SUBJECT_ID = 'subject_id'
- RESERVATION_ID = 'reservation_id'
- ROOM_ID = 'room_id'
- SEARCH_STRING = 'search'
- TO_DATE = 'to'
- USER_ID = 'user_id'
- $args : array<string|int, mixed>
- HTTP query args and params
- $logger : LoggerInterface
- $pagination : Pagination|null
- $request : ServerRequestInterface
- HTTP request
- $response : ResponseInterface
- HTTP response
- $statsRepository : IStatsRepository
- __construct() : mixed
- __invoke() : ResponseInterface
- Called to handle request
- preparePagination() : Pagination
- prepares pagination feature object
- action() : ResponseInterface
- {@inheritDoc}
- getFormData() : stdClass
- get form data of the request
- getTimeSpanParans() : stdClass
- Collects 'from' and 'to' params from query string
- resolveArg() : mixed
- Resolves argument from URI string
- resolveQueryArg() : mixed
- Resolves argument from query string.
- respond() : ResponseInterface
- sends response from the API with provided $payload
- respondWithData() : ResponseInterface
- responds with given data
Constants
ACCESS_ID
protected
mixed
ACCESS_ID
= 'access_id'
ADDRESS_ID
protected
mixed
ADDRESS_ID
= 'address_id'
BUILDING_ID
protected
mixed
BUILDING_ID
= 'building_id'
FROM_DATE
protected
mixed
FROM_DATE
= 'from'
IMAGE_ID
protected
mixed
IMAGE_ID
= 'image_id'
REQUEST_SUBJECT
protected
mixed
REQUEST_SUBJECT
= 'request_subject'
REQUEST_SUBJECT_ID
protected
mixed
REQUEST_SUBJECT_ID
= 'subject_id'
RESERVATION_ID
protected
mixed
RESERVATION_ID
= 'reservation_id'
ROOM_ID
protected
mixed
ROOM_ID
= 'room_id'
SEARCH_STRING
protected
mixed
SEARCH_STRING
= 'search'
TO_DATE
protected
mixed
TO_DATE
= 'to'
USER_ID
protected
mixed
USER_ID
= 'user_id'
Properties
$args
HTTP query args and params
protected
array<string|int, mixed>
$args
$logger
protected
LoggerInterface
$logger
$pagination
protected
Pagination|null
$pagination
= NULL
$request
HTTP request
protected
ServerRequestInterface
$request
$response
HTTP response
protected
ResponseInterface
$response
$statsRepository
protected
IStatsRepository
$statsRepository
Methods
__construct()
public
__construct(LoggerInterface $logger) : mixed
Parameters
- $logger : LoggerInterface
Return values
mixed —__invoke()
Called to handle request
public
__invoke(ServerRequestInterface $request, ResponseInterface $response, array<string|int, mixed> $args) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $response : ResponseInterface
- $args : array<string|int, mixed>
Tags
Return values
ResponseInterface —preparePagination()
prepares pagination feature object
public
preparePagination() : Pagination
Return values
Pagination —action()
{@inheritDoc}
protected
action() : ResponseInterface
Return values
ResponseInterface —getFormData()
get form data of the request
protected
getFormData() : stdClass
Return values
stdClass —getTimeSpanParans()
Collects 'from' and 'to' params from query string
protected
getTimeSpanParans([string $defaultFrom = '2 month ago' ][, string $defaultTo = 'now' ]) : stdClass
Parameters
- $defaultFrom : string = '2 month ago'
- $defaultTo : string = 'now'
Return values
stdClass —resolveArg()
Resolves argument from URI string
protected
resolveArg(string $name[, mixed $default = NULL ]) : mixed
Parameters
- $name : string
- $default : mixed = NULL
Tags
Return values
mixed —resolveQueryArg()
Resolves argument from query string.
protected
resolveQueryArg(string $name[, mixed $default = NULL ]) : mixed
Parameters
- $name : string
- $default : mixed = NULL
Tags
Return values
mixed —respond()
sends response from the API with provided $payload
protected
respond(ActionPayload $payload) : ResponseInterface
Parameters
- $payload : ActionPayload
Return values
ResponseInterface —respondWithData()
responds with given data
protected
respondWithData([mixed $data = null ][, int $statusCode = 200 ]) : ResponseInterface
Parameters
- $data : mixed = null
- $statusCode : int = 200