Shop_Cart_Controller_Default
extends Shop_Cart_Controller
in package
Shop_Cart_Controller Default Handler
Tags
Table of Contents
Properties
- $instance : mixed
- The singleton instances.
- $_allowedProperties : array<string|int, mixed>
- Allowed object properties
- $_error : mixed
- Last error, default FALSE 1 - Shop item id is NULL 2 - Shop item doesn't exist 3 - Siteuser doesn't have access to the shop item 4 - zero quantity or shop item out of stock
- $_propertiesValues : array<string|int, mixed>
- Properties values
- $_unlimitedProperties : bool
- Object has unlimited number of properties
Methods
- __construct() : mixed
- Constructor.
- add() : Shop_Cart_Controller
- Add item into cart
- addAllowedProperties() : self
- Add additional allowed properties
- addAllowedProperty() : self
- Add additional allowed property
- clear() : Shop_Cart_Controller
- Clear cart operation's options
- clearSessionCart() : Shop_Cart_Controller
- Clear session cart
- delete() : Shop_Cart_Controller
- Delete item from cart
- get() : object
- Get item from cart
- getAll() : array<string|int, mixed>
- Get all goods in the cart
- getLastError() : bool|int
- Get Last Error
- instance() : object
- Register an existing instance as a singleton.
- moveTemporaryCart() : self
- Move goods from session cart to database
- set() : self
- Run when writing data to inaccessible properties
- setUnlimitedProperties() : self
- Set unlimitedProperties
- update() : Shop_Cart_Controller
- Update item in cart
- _getAllFromDb() : array<string|int, mixed>
- Get all carts from database
- _getAllFromSession() : array<string|int, mixed>
- Get all carts from session
- _getDriverName() : srting
- Get full driver name
Properties
$instance
The singleton instances.
public
static mixed
$instance
= array()
$_allowedProperties
Allowed object properties
protected
array<string|int, mixed>
$_allowedProperties
= array()
$_error
Last error, default FALSE 1 - Shop item id is NULL 2 - Shop item doesn't exist 3 - Siteuser doesn't have access to the shop item 4 - zero quantity or shop item out of stock
protected
mixed
$_error
= \FALSE
$_propertiesValues
Properties values
protected
array<string|int, mixed>
$_propertiesValues
= array()
$_unlimitedProperties
Object has unlimited number of properties
protected
bool
$_unlimitedProperties
= \FALSE
Methods
__construct()
Constructor.
public
__construct() : mixed
add()
Add item into cart
public
add() : Shop_Cart_Controller
Tags
Return values
Shop_Cart_ControlleraddAllowedProperties()
Add additional allowed properties
public
addAllowedProperties(array<string|int, mixed> $array) : self
Parameters
- $array : array<string|int, mixed>
-
array of properties' names
Return values
selfaddAllowedProperty()
Add additional allowed property
public
addAllowedProperty(string $property) : self
Parameters
- $property : string
-
property name
Return values
selfclear()
Clear cart operation's options
public
clear() : Shop_Cart_Controller
Tags
Return values
Shop_Cart_ControllerclearSessionCart()
Clear session cart
public
clearSessionCart() : Shop_Cart_Controller
Return values
Shop_Cart_Controllerdelete()
Delete item from cart
public
delete() : Shop_Cart_Controller
Tags
Return values
Shop_Cart_Controllerget()
Get item from cart
public
get() : object
Tags
Return values
objectgetAll()
Get all goods in the cart
public
getAll(Shop_Model $oShop) : array<string|int, mixed>
Parameters
- $oShop : Shop_Model
-
shop
Tags
Return values
array<string|int, mixed>getLastError()
Get Last Error
public
getLastError() : bool|int
Return values
bool|intinstance()
Register an existing instance as a singleton.
public
static instance([string $name = 'default' ]) : object
Parameters
- $name : string = 'default'
-
driver's name
Return values
objectmoveTemporaryCart()
Move goods from session cart to database
public
moveTemporaryCart(Shop_Model $oShop) : self
Parameters
- $oShop : Shop_Model
-
shop
Tags
Return values
selfset()
Run when writing data to inaccessible properties
public
set(string $property, string $value) : self
Parameters
- $property : string
-
property name
- $value : string
-
property value
Return values
selfsetUnlimitedProperties()
Set unlimitedProperties
public
setUnlimitedProperties([bool $value = TRUE ]) : self
Parameters
- $value : bool = TRUE
-
default TRUR
Return values
selfupdate()
Update item in cart
public
update() : Shop_Cart_Controller
Tags
Return values
Shop_Cart_Controller_getAllFromDb()
Get all carts from database
protected
_getAllFromDb(Shop_Model $oShop) : array<string|int, mixed>
Parameters
- $oShop : Shop_Model
-
shop
Return values
array<string|int, mixed>_getAllFromSession()
Get all carts from session
protected
_getAllFromSession(Shop_Model $oShop) : array<string|int, mixed>
Parameters
- $oShop : Shop_Model
-
shop
Return values
array<string|int, mixed>_getDriverName()
Get full driver name
protected
static _getDriverName(string $driver) : srting
Parameters
- $driver : string
-
driver name