AbstractApiV2Controller

Class AbstractApiV2Controller

This class defines the inner core functionality of a ApiV2Controller. It contains the initialization and request validation functionality that every controller must have.

The functionality of this class is mark as private because child controllers must not alter the state at this point but rather adjust to it. This will force them to follow the same principles and methodologies.

Child API controllers can use the "init" method to initialize their common dependencies.

category

System

package

ApiV2Controllers

Methods

AbstractApiV2Controller Constructor

__construct(\Slim\Slim $api, array $uri) 

Call this constructor from every child controller class in order to set the Slim instance and the request routes arguments to the class.

deprecated

The "__initialize" method will is deprecated and will be removed in a future version. Please use the new "init" for bootstrapping your child API controllers.

Throws
\HttpApiV2Exception

Through _validateRequest

Arguments

$api

\Slim\Slim

Slim framework instance, used for request/response manipulation.

$uri

array

This array contains all the segments of the current request, starting from the resource.

Constants

Defines the default page offset for responses that return multiple items.

DEFAULT_PAGE_ITEMS
var

Default controller to be loaded when no resource was selected.

DEFAULT_CONTROLLER_NAME
var

Defines the maximum request limit for an authorized client.

DEFAULT_RATE_LIMIT
var

Defines the duration of an API session in minutes.

DEFAULT_RATE_RESET_PERIOD
var

Properties