Basket extends Controller
Table of Contents
Constants
- ERROR_REQUIRED_PARAMETER = 'MAIN_CONTROLLER_22001'
- ERROR_UNKNOWN_ACTION = 'MAIN_CONTROLLER_22002'
- EVENT_ON_AFTER_ACTION = 'onAfterAction'
- EVENT_ON_BEFORE_ACTION = 'onBeforeAction'
- EXCEPTION_UNKNOWN_ACTION = 22002
- SCOPE_AJAX = 'ajax'
- SCOPE_CLI = 'cli'
- SCOPE_REST = 'rest'
Methods
- __construct() : mixed
- Constructor Controller.
- addAction() : mixed
- canBuyAction() : mixed
- checkProductBarcodeAction() : mixed
- className() : string
- Returns the fully qualified name of this class.
- configureActions() : array<string|int, mixed>
- convertKeysToCamelCase() : array<string|int, mixed>|mixed|string
- Converts keys of array to camel case notation.
- deleteAction() : mixed
- finalizeResponse() : void
- Finalizes response.
- forward() : HttpResponse|mixed
- generateActionMethodName() : string
- getAction() : mixed
- getActionUri() : Uri
- Returns uri for ajax end point for the action name. It's a helper, which uses relative action name without controller name.
- getAutoWiredParameters() : array<string|int, Parameter>
- getBasePriceAction() : mixed
- getBasePriceWithVatAction() : mixed
- getBuilder() : mixed
- getConfigurationOfActions() : array<string|int, mixed>|null
- getCurrencyAction() : mixed
- getCurrentUser() : CurrentUser
- getDefaultAutoWiredParameters() : array<string|int, Parameter>
- getDefaultPriceAction() : mixed
- getDiscountPriceAction() : mixed
- getErrorByCode() : Error
- Getting once error with the necessary code.
- getErrors() : array<string|int, Error>
- Getting array of errors.
- getFieldsAction() : mixed
- getFinalPriceAction() : mixed
- getFullEventName() : string
- getInitialPriceAction() : mixed
- getModuleId() : string
- Returns module id.
- getPriceAction() : mixed
- getPriceWithVatAction() : mixed
- getPrimaryAutoWiredParameter() : Parameter|null
- getProductIdAction() : mixed
- getQuantityAction() : mixed
- getRequest() : HttpRequest
- getReservedQuantityAction() : mixed
- getScope() : string
- getSourceParametersList() : array<string|int, mixed>
- getUnsignedParameters() : mixed
- getVatAction() : mixed
- getVatRateAction() : mixed
- getWeightAction() : mixed
- isBarcodeMultiAction() : mixed
- isCustomMultiAction() : mixed
- isCustomPriceAction() : mixed
- isDelayAction() : mixed
- isLocatedUnderPsr4() : bool
- isVatInPriceAction() : mixed
- listAction() : mixed
- listNameActions() : array<string|int, mixed>
- Returns list of all
- modifyAction() : mixed
- prepareFields() : mixed
- redirectTo() : Redirect
- Redirect to URL.
- run() : HttpResponse|mixed
- setCurrentUser() : void
- setScope() : Controller
- setSourceParametersList() : Controller
- updateAction() : mixed
Constants
ERROR_REQUIRED_PARAMETER
public
mixed
ERROR_REQUIRED_PARAMETER
= 'MAIN_CONTROLLER_22001'
ERROR_UNKNOWN_ACTION
public
mixed
ERROR_UNKNOWN_ACTION
= 'MAIN_CONTROLLER_22002'
EVENT_ON_AFTER_ACTION
public
mixed
EVENT_ON_AFTER_ACTION
= 'onAfterAction'
EVENT_ON_BEFORE_ACTION
public
mixed
EVENT_ON_BEFORE_ACTION
= 'onBeforeAction'
EXCEPTION_UNKNOWN_ACTION
public
mixed
EXCEPTION_UNKNOWN_ACTION
= 22002
SCOPE_AJAX
public
mixed
SCOPE_AJAX
= 'ajax'
SCOPE_CLI
public
mixed
SCOPE_CLI
= 'cli'
SCOPE_REST
public
mixed
SCOPE_REST
= 'rest'
Methods
__construct()
Constructor Controller.
public
__construct([Request|null $request = null ]) : mixed
Parameters
- $request : Request|null = null
addAction()
public
addAction(array<string|int, mixed> $fields) : mixed
Parameters
- $fields : array<string|int, mixed>
canBuyAction()
public
canBuyAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
checkProductBarcodeAction()
public
checkProductBarcodeAction(BasketItem $basket, array<string|int, mixed> $fields) : mixed
Parameters
- $basket : BasketItem
- $fields : array<string|int, mixed>
className()
Returns the fully qualified name of this class.
public
final static className() : string
Return values
stringconfigureActions()
public
configureActions() : array<string|int, mixed>
Return values
array<string|int, mixed>convertKeysToCamelCase()
Converts keys of array to camel case notation.
public
convertKeysToCamelCase(mixed $data) : array<string|int, mixed>|mixed|string
Parameters
- $data : mixed
-
Data.
Tags
Return values
array<string|int, mixed>|mixed|stringdeleteAction()
public
deleteAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
finalizeResponse()
Finalizes response.
public
finalizeResponse(Response $response) : void
The method will be invoked when HttpApplication will be ready to send response to client. It's a final place where Controller can interact with response.
Parameters
- $response : Response
forward()
public
forward(Controller|string $controller, string $actionName[, array<string|int, mixed>|null $parameters = null ]) : HttpResponse|mixed
Parameters
- $controller : Controller|string
- $actionName : string
- $parameters : array<string|int, mixed>|null = null
Tags
Return values
HttpResponse|mixedgenerateActionMethodName()
public
final generateActionMethodName(mixed $action) : string
Parameters
- $action : mixed
Return values
stringgetAction()
public
getAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getActionUri()
Returns uri for ajax end point for the action name. It's a helper, which uses relative action name without controller name.
public
final getActionUri(string $actionName[, array<string|int, mixed> $params = [] ][, bool $absolute = false ]) : Uri
Parameters
- $actionName : string
-
Action name. It's a relative action name without controller name.
- $params : array<string|int, mixed> = []
-
Parameters for creating uri.
- $absolute : bool = false
Return values
UrigetAutoWiredParameters()
public
getAutoWiredParameters() : array<string|int, Parameter>
Return values
array<string|int, Parameter>getBasePriceAction()
public
getBasePriceAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getBasePriceWithVatAction()
public
getBasePriceWithVatAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getBuilder()
public
getBuilder([SettingsContainer $settings = null ]) : mixed
Parameters
- $settings : SettingsContainer = null
getConfigurationOfActions()
public
final getConfigurationOfActions() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetCurrencyAction()
public
getCurrencyAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getCurrentUser()
public
final getCurrentUser() : CurrentUser
Return values
CurrentUsergetDefaultAutoWiredParameters()
public
final getDefaultAutoWiredParameters() : array<string|int, Parameter>
Return values
array<string|int, Parameter>getDefaultPriceAction()
public
getDefaultPriceAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getDiscountPriceAction()
public
getDiscountPriceAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getErrorByCode()
Getting once error with the necessary code.
public
final getErrorByCode(string $code) : Error
Parameters
- $code : string
-
Code of error.
Return values
ErrorgetErrors()
Getting array of errors.
public
final getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getFieldsAction()
public
getFieldsAction() : mixed
getFinalPriceAction()
public
getFinalPriceAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getFullEventName()
public
final static getFullEventName(mixed $eventName) : string
Parameters
- $eventName : mixed
Return values
stringgetInitialPriceAction()
public
getInitialPriceAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getModuleId()
Returns module id.
public
final getModuleId() : string
Tries to guess module id by file path and function @see getModuleId().
Return values
stringgetPriceAction()
public
getPriceAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getPriceWithVatAction()
public
getPriceWithVatAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getPrimaryAutoWiredParameter()
public
getPrimaryAutoWiredParameter() : Parameter|null
Return values
Parameter|nullgetProductIdAction()
public
getProductIdAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getQuantityAction()
public
getQuantityAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getRequest()
public
final getRequest() : HttpRequest
Return values
HttpRequestgetReservedQuantityAction()
public
getReservedQuantityAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getScope()
public
final getScope() : string
Return values
stringgetSourceParametersList()
public
final getSourceParametersList() : array<string|int, mixed>
Return values
array<string|int, mixed>getUnsignedParameters()
public
final getUnsignedParameters() : mixed
getVatAction()
public
getVatAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getVatRateAction()
public
getVatRateAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
getWeightAction()
public
getWeightAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
isBarcodeMultiAction()
public
isBarcodeMultiAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
isCustomMultiAction()
public
isCustomMultiAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
isCustomPriceAction()
public
isCustomPriceAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
isDelayAction()
public
isDelayAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
isLocatedUnderPsr4()
public
final isLocatedUnderPsr4() : bool
Return values
boolisVatInPriceAction()
public
isVatInPriceAction(BasketItem $basket) : mixed
Parameters
- $basket : BasketItem
listAction()
public
listAction([mixed $select = [] ], mixed $filter[, mixed $order = [] ], PageNavigation $pageNavigation) : mixed
Parameters
- $select : mixed = []
- $filter : mixed
- $order : mixed = []
- $pageNavigation : PageNavigation
listNameActions()
Returns list of all
public
final listNameActions() : array<string|int, mixed>
Return values
array<string|int, mixed>modifyAction()
public
modifyAction(array<string|int, mixed> $fields) : mixed
Parameters
- $fields : array<string|int, mixed>
prepareFields()
public
static prepareFields(mixed $fields) : mixed
Parameters
- $fields : mixed
redirectTo()
Redirect to URL.
public
redirectTo(string $url) : Redirect
Parameters
- $url : string
Return values
Redirectrun()
public
final run(mixed $actionName, array<string|int, mixed> $sourceParametersList) : HttpResponse|mixed
Parameters
- $actionName : mixed
- $sourceParametersList : array<string|int, mixed>
Tags
Return values
HttpResponse|mixedsetCurrentUser()
public
final setCurrentUser(CurrentUser $currentUser) : void
Parameters
- $currentUser : CurrentUser
setScope()
public
final setScope(string $scope) : Controller
Parameters
- $scope : string
Return values
ControllersetSourceParametersList()
public
final setSourceParametersList(array<string|int, mixed> $sourceParametersList) : Controller
Parameters
- $sourceParametersList : array<string|int, mixed>
Return values
ControllerupdateAction()
public
updateAction(BasketItem $basket, array<string|int, mixed> $fields) : mixed
Parameters
- $basket : BasketItem
- $fields : array<string|int, mixed>