SharedShoppingCartReader
in package
implements
SharedShoppingCartReaderInterface
Class SharedShoppingCartReader
Tags
Interfaces, Classes and Traits
- SharedShoppingCartReaderInterface
- Interface SharedShoppingCartReaderInterface
Table of Contents
- $db : CI_DB_query_builder
- __construct() : mixed
- SharedShoppingCartReader constructor.
- getShoppingCart() : string
- Gets the content in JSON format of the shopping cart corresponding to the hash
- getShoppingCartsByCustomerId() : SharedShoppingCartCollection
- Gets a collection of all shared shopping carts by a given customer ID.
- createSharedShoppingCartFromArray() : bool|SharedShoppingCart
- Creates a shared shopping cart instance from an array.
Properties
$db
protected
CI_DB_query_builder
$db
Methods
__construct()
SharedShoppingCartReader constructor.
public
__construct(CI_DB_query_builder $db) : mixed
Parameters
- $db : CI_DB_query_builder
Return values
mixed —getShoppingCart()
Gets the content in JSON format of the shopping cart corresponding to the hash
public
getShoppingCart(StringType $shoppingCartHash) : string
Parameters
- $shoppingCartHash : StringType
-
Hash of the shopping cart
Return values
string —JSON representation of the shopping cart
getShoppingCartsByCustomerId()
Gets a collection of all shared shopping carts by a given customer ID.
public
getShoppingCartsByCustomerId(IdType $customerId) : SharedShoppingCartCollection
Parameters
- $customerId : IdType
Return values
SharedShoppingCartCollection —createSharedShoppingCartFromArray()
Creates a shared shopping cart instance from an array.
protected
createSharedShoppingCartFromArray(array<string|int, mixed> $rawShoppingCart) : bool|SharedShoppingCart
Parameters
- $rawShoppingCart : array<string|int, mixed>