Class ManufacturersApiV2Controller

Class HttpApiV2Controller

Contains common functionality for all the GX2 APIv2 controllers. You can use the $api instance in the child-controllers in order to gain access to request and response information. The $uri variable is an array that contains the requested resource path.

You can use a protected "__initialize" method in your child controllers for performing common operations without overriding the parent constructor method.

This class contains some private methods that define the core operations of each controller and should not be called from a child-controller (like validation, authorization, rate limiting). The only way to disable the execution of these methods is to override the controller.

AbstractApiV2Controller
HttpApiV2Controller
ManufacturersApiV2Controller
Package: ApiV2Controllers
Category: System
See: AbstractApiV2Controller
Todo:

Add _cacheResponse() helper function which will cache request data and it will provide the required headers.


Located at Controllers/Api/v2/ManufacturersApiV2Controller.inc.php

Methods summary

protected __initialize( void )

Initializes the manufacturers api controller.

public get( void )
public post( void )
public patch( void )
public delete( void )
protected _serializeManufacturer( ManufacturerInterface $manufacturer ) : array

Serializes manufacturer entities.

protected _deserializeManufacturer( string $manufacturerJson, $id = null ) : Manufacturer

Deserialize manufacturer entities.

protected _serializeManufacturerCollection( ManufacturerCollection $manufacturerCollection ) : array

Serializes manufacturer collections.

Methods inherited from HttpApiV2Controller

_linkResponse(), _locateResource(), _mapResponse(), _minimizeResponse(), _paginateResponse(), _searchResponse(), _setJsonValue(), _sortResponse(), _writeResponse()

Methods inherited from AbstractApiV2Controller

__construct(), _prepareResponse(), _setRateLimitHeader(), _validateRequest()

Constants summary

Constants inherited from AbstractApiV2Controller

DEFAULT_CONTROLLER_NAME, DEFAULT_PAGE_ITEMS, DEFAULT_RATE_LIMIT, DEFAULT_RATE_RESET_PERIOD

Properties summary

Properties inherited from AbstractApiV2Controller

$api, $uri