Documentation

Shop_Cart_Controller_Default extends Shop_Cart_Controller
in package

Shop_Cart_Controller Default Handler

Tags
see
Shop_Cart_Controller
subpackage

Shop

version
7.x
author

Hostmake LLC

copyright

© 2005-2024 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

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

addAllowedProperties()

Add additional allowed properties

public addAllowedProperties(array<string|int, mixed> $array) : self
Parameters
$array : array<string|int, mixed>

array of properties' names

Return values
self

addAllowedProperty()

Add additional allowed property

public addAllowedProperty(string $property) : self
Parameters
$property : string

property name

Return values
self

get()

Get item from cart

public get() : object
Tags
hostcms-event

Shop_Cart_Controller.onBeforeGet

hostcms-event

Shop_Cart_Controller.onAfterGet

Return values
object

getAll()

Get all goods in the cart

public getAll(Shop_Model $oShop) : array<string|int, mixed>
Parameters
$oShop : Shop_Model

shop

Tags
hostcms-event

Shop_Cart_Controller.onBeforeGetAll

hostcms-event

Shop_Cart_Controller.onAfterGetAll

Return values
array<string|int, mixed>

getLastError()

Get Last Error

public getLastError() : bool|int
Return values
bool|int

instance()

Register an existing instance as a singleton.

public static instance([string $name = 'default' ]) : object
Parameters
$name : string = 'default'

driver's name

Return values
object

moveTemporaryCart()

Move goods from session cart to database

public moveTemporaryCart(Shop_Model $oShop) : self
Parameters
$oShop : Shop_Model

shop

Tags
hostcms-event

Shop_Cart_Controller.onBeforeMoveTemporaryCart

hostcms-event

Shop_Cart_Controller.onAfterMoveTemporaryCart

hostcms-event

Shop_Cart_Controller.onAfterMoveTemporaryCartItem

Return values
self

set()

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
self

setUnlimitedProperties()

Set unlimitedProperties

public setUnlimitedProperties([bool $value = TRUE ]) : self
Parameters
$value : bool = TRUE

default TRUR

Return values
self

_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

Return values
srting

        
On this page

Search results