ProductsApiV2Controller

Extends \HttpApiV2Controller

Class ProductsApiV2Controller

Provides a gateway to the ProductWriteService and ProductReadService classes, which handle the shop product resources.

category

System

package

ApiV2Controllers

Methods

AbstractApiV2Controller Constructor

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

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.

delete

delete() 
api
apiVersion

2.1.0

apiName

DeleteProduct

apiGroup

Products

apiDescription

Removes a product record from the database. To see an example usage take a look at docs/REST/samples/product-service/remove_product.php

get

get() 
api
apiVersion

2.6.0

apiName

GetProduct

apiGroup

Products

apiDescription

Get multiple or a single product records through a GET request. This method supports all the GET parameters that are mentioned in the "Introduction" section of this documentation. To see an example usage take a look at docs/REST/samples/product-service/remove_product.php

Get product using it's ID

getBy(integer $id = null) 
Throws
\HttpApiV2Exception

if the product does not exists

Arguments

$id

integer

product ID to be searched

Get products by its categories search by categories

getByCategories( $category_id = null) 

This method will search all products with a with an given category.

Throws
\HttpApiV2Exception

if something gets wrong while searching the database

Arguments

$category_id

the category ID to be searched

getCallableResource

getCallableResource( $controller, array $mappedURI, \Slim\Slim $api) 
inherited static

Arguments

$controller

$mappedURI

array

$api

\Slim\Slim

post

post() 
api
apiVersion

2.6.0

apiName

CreateProduct

apiGroup

Products

apiDescription

Creates a new product record or multiple new product records in the system. To see an example usage take a look at docs/REST/samples/product-service/create_product.php

put

put() 
api
apiVersion

2.1.0

apiName

ProductCategory

apiGroup

Products

apiDescription

Use this method to update an existing product record. Take a look in the POST method for more detailed explanation on every resource property. To see an example usage consider docs/REST/samples/product-service/update_product.php

Constants

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

DEFAULT_PAGE_ITEMS
inherited
var

Default controller to be loaded when no resource was selected.

DEFAULT_CONTROLLER_NAME
inherited
var

Defines the maximum request limit for an authorized client.

DEFAULT_RATE_LIMIT
inherited
var

Defines the duration of an API session in minutes.

DEFAULT_RATE_RESET_PERIOD
inherited
var

Properties