ShoppingCart
in package
Table of Contents
- $customerId : CustomerId
- $items : ShoppingCartItems
- create() : self
- Creates a new instance of Shopping Cart
- customerId() : int
- Returns the Customer ID
- items() : ShoppingCartItems
- Returns the Shopping Cart Items
- toArray() : array<string|int, mixed>
- Returns an array containing the class members
- __construct() : mixed
- Constructor
Properties
$customerId
private
CustomerId
$customerId
$items
private
ShoppingCartItems
$items
Methods
create()
Creates a new instance of Shopping Cart
public
static create(CustomerId $customerId, ShoppingCartItems $items) : self
Parameters
- $customerId : CustomerId
- $items : ShoppingCartItems
Return values
self —customerId()
Returns the Customer ID
public
customerId() : int
Return values
int —items()
Returns the Shopping Cart Items
public
items() : ShoppingCartItems
Return values
ShoppingCartItems —toArray()
Returns an array containing the class members
public
toArray([mixed $format = "Y-m-d" ]) : array<string|int, mixed>
Parameters
- $format : mixed = "Y-m-d"
Return values
array<string|int, mixed> —__construct()
Constructor
private
__construct(CustomerId $customerId, ShoppingCartItems $items) : mixed
Parameters
- $customerId : CustomerId
- $items : ShoppingCartItems