ShoppingCartFactory
in package
Table of Contents
- createCustomerId() : CustomerId
- Creates a new instance of Customer ID
- createProductId() : ProductId
- Creates a new instance of Product ID
- createSelectedOption() : SelectedOption
- Creates a new instance of Selected Option
- createSelectedOptions() : SelectedOptions
- Creates a new instance of Selected Options
- createShoppingCartItem() : ShoppingCartItem
- Creates a new instance of Shopping Cart
- createShoppingCartItemId() : ShoppingCartItemId
- Creates a new instance of Shopping Cart Item ID
- createShoppingCartItems() : ShoppingCartItems
- Creates a new instance of Shopping Cart Items
Methods
createCustomerId()
Creates a new instance of Customer ID
public
createCustomerId(int $id) : CustomerId
Parameters
- $id : int
Return values
CustomerId —createProductId()
Creates a new instance of Product ID
public
createProductId(string $id) : ProductId
Parameters
- $id : string
Return values
ProductId —createSelectedOption()
Creates a new instance of Selected Option
public
createSelectedOption(string $optionKey, string $optionValue) : SelectedOption
Parameters
- $optionKey : string
- $optionValue : string
Return values
SelectedOption —createSelectedOptions()
Creates a new instance of Selected Options
public
createSelectedOptions(SelectedOption ...$options) : SelectedOptions
Parameters
- $options : SelectedOption
Return values
SelectedOptions —createShoppingCartItem()
Creates a new instance of Shopping Cart
public
createShoppingCartItem(string $productId, int $shoppingCartItemId, string $itemNumber, string $title, string $image, int $amount, DateTimeImmutable $addedAt, SelectedOptions $selectedOptions) : ShoppingCartItem
Parameters
- $productId : string
- $shoppingCartItemId : int
- $itemNumber : string
- $title : string
- $image : string
- $amount : int
- $addedAt : DateTimeImmutable
- $selectedOptions : SelectedOptions
Return values
ShoppingCartItem —createShoppingCartItemId()
Creates a new instance of Shopping Cart Item ID
public
createShoppingCartItemId(int $id) : ShoppingCartItemId
Parameters
- $id : int
Return values
ShoppingCartItemId —createShoppingCartItems()
Creates a new instance of Shopping Cart Items
public
createShoppingCartItems(ShoppingCartItem ...$items) : ShoppingCartItems
Parameters
- $items : ShoppingCartItem