Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • AdminAccess
    • Collections
    • Deleters
    • Entities
    • Exceptions
    • Factories
    • Interfaces
    • Managers
    • Readers
    • Writers
  • AdminHttpViewControllers
  • ApiV2Controllers
  • Authentication
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Strategies
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Storages
    • Validation
    • ValueObjects
  • CustomerGroup
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Serializers
    • Services
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Extensions
    • Customers
    • Emails
    • Geschaeftskundenversand
    • Helpers
    • Invoices
    • Orders
    • ParcelShopFinder
    • QuickEdit
    • Serializers
    • Templates
  • Geschaeftskundenversand
    • Exceptions
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • HttpViewControllers
  • InfoBox
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
  • Invoice
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • Manufacturer
    • Entities
    • Factories
    • Interfaces
    • Repositories
  • Modules
    • Collections
    • Controllers
    • Interfaces
  • None
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • OrderStatus
    • Collections
    • Entities
    • Exceptions
    • Factories
    • Interfaces
    • Repositories
  • Precheck
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • QuantityUnit
    • Entities
    • Factories
    • Repositories
  • QuickEdit
    • Interfaces
    • Repositories
  • Review
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Services
    • ValueObjects
  • Shared
    • ClassFinder
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • SharedShoppingCart
    • Interfaces
  • Slider
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
  • Smarty
    • plugins
  • StaticSeoUrl
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
  • StaticSeoUrls
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository
  • VersionInfo
    • Factories
    • Reader
    • ValueObjects
  • VPE
    • Entities
    • Factories
    • Repositories
  • Withdrawal
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Services
    • ValueObjects

Classes

  • AbstractApiV2Controller
  • AbstractImagesApiV2Controller
  • AddressesApiV2Controller
  • AddressFormatsApiV2Controller
  • AttachmentsApiV2Controller
  • CategoriesApiV2Controller
  • CategoryIconsApiV2Controller
  • CategoryImagesApiV2Controller
  • CountriesApiV2Controller
  • CustomerGroupsApiV2Controller
  • CustomersApiV2Controller
  • DefaultApiV2Controller
  • EmailsApiV2Controller
  • HttpApiV2Controller
  • ManufacturersApiV2Controller
  • OrdersApiV2Controller
  • OrdersHistoryApiV2Controller
  • OrdersItemsApiV2Controller
  • OrdersItemsAttributesApiV2Controller
  • OrderStatusesApiV2Controller
  • OrdersTotalsApiV2Controller
  • ProductImagesApiV2Controller
  • ProductReviewsApiV2Controller
  • ProductsApiV2Controller
  • ProductsLinksApiV2Controller
  • QuantityUnitsApiV2Controller
  • ReviewsApiV2Controller
  • ShopInformationApiV2Controller
  • TaxClassesApiV2Controller
  • TaxRatesApiV2Controller
  • TaxZonesApiV2Controller
  • TrackingCodeApiV2Controller
  • VpeApiV2Controller
  • WithdrawalsApiV2Controller
  • ZonesApiV2Controller

Class 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.

Direct known subclasses

HttpApiV2Controller

Indirect known subclasses

AbstractImagesApiV2Controller, AddressesApiV2Controller, DefaultApiV2Controller, EmailsApiV2Controller, ManufacturersApiV2Controller, OrdersApiV2Controller, OrdersHistoryApiV2Controller, OrdersItemsApiV2Controller, OrdersItemsAttributesApiV2Controller, OrderStatusesApiV2Controller, OrdersTotalsApiV2Controller, ProductImagesApiV2Controller, AddressFormatsApiV2Controller, ProductReviewsApiV2Controller, ProductsApiV2Controller, ProductsLinksApiV2Controller, QuantityUnitsApiV2Controller, ReviewsApiV2Controller, ShopInformationApiV2Controller, TaxClassesApiV2Controller, TaxRatesApiV2Controller, TaxZonesApiV2Controller, TrackingCodeApiV2Controller, AttachmentsApiV2Controller, VpeApiV2Controller, WithdrawalsApiV2Controller, ZonesApiV2Controller, CategoriesApiV2Controller, CategoryIconsApiV2Controller, CategoryImagesApiV2Controller, CountriesApiV2Controller, CustomerGroupsApiV2Controller, CustomersApiV2Controller

Abstract
Package: ApiV2Controllers
Category: System
Located at Controllers/Api/AbstractApiV2Controller.inc.php

Methods summary

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

AbstractApiV2Controller Constructor

AbstractApiV2Controller Constructor

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.


Parameters

$api
Slim framework instance, used for request/response manipulation.
$uri
This array contains all the segments of the current request, starting from the resource.

Throws

HttpApiV2Exception
Through _validateRequest
protected
# _validateRequest( )

[PRIVATE] Validate request before proceeding with response.

[PRIVATE] Validate request before proceeding with response.

This method will validate the request headers, user authentication and other parameters before the controller proceeds with the response.

Not available to child-controllers (private method).

Throws

HttpApiV2Exception
If validation fails - 415 Unsupported media type.
protected
# _prepareResponse( )

[PRIVATE] Prepare response headers.

[PRIVATE] Prepare response headers.

This method will prepare default attributes of the API responses. Further response settings must be set explicitly from each controller method separately.

Not available to child-controllers (private method).

protected
# _setRateLimitHeader( )

[PRIVATE] Handle rate limit headers.

[PRIVATE] Handle rate limit headers.

There is a cache file that will store each user session and provide a security mechanism that will protect the shop from DOS attacks or service overuse. Each session will use the hashed "Authorization header" to identify the client. When the limit is reached a "HTTP/1.1 429 Too Many Requests" will be returned.

Headers: X-Rate-Limit-Limit >> Max number of requests allowed. X-Rate-Limit-Remaining >> Number of requests remaining. X-Rate-Limit-Reset >> UTC epoch seconds until the limit is reset.

Important: This method will be executed in every API call and it might slow the response time due to filesystem operations. If the difference is significant then it should be optimized.

Not available to child-controllers (private method).

Throws

HttpApiV2Exception
If request limit exceed - 429 Too Many Requests

Constants summary

integer DEFAULT_PAGE_ITEMS

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

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

# 50
string DEFAULT_CONTROLLER_NAME

Default controller to be loaded when no resource was selected.

Default controller to be loaded when no resource was selected.

# 'DefaultApiV2Controller'
integer DEFAULT_RATE_LIMIT

Defines the maximum request limit for an authorized client.

Defines the maximum request limit for an authorized client.

# 5000
integer DEFAULT_RATE_RESET_PERIOD

Defines the duration of an API session in minutes.

Defines the duration of an API session in minutes.

# 15

Properties summary

protected Slim\Slim $api

Slim Framework instance is used to manipulate the request or response data.

Slim Framework instance is used to manipulate the request or response data.

#
protected array $uri

Contains the request URI segments after the root api version segment.

Contains the request URI segments after the root api version segment.

Example: URI - api.php/v2/customers/73/addresses CODE - $this->uri[1]; // will return '73'

#
API documentation generated by ApiGen