WishlistItem
in package
Table of Contents
- $addedAt : DateTimeImmutable
- $amount : int
- $details : ItemDetails
- $productId : ProductId
- $selectedOptions : SelectedOptions
- $wishlistItemId : WishlistItemId
- addedAt() : string
- Returns the Added Date
- amount() : int
- Returns the Amount
- create() : self
- Creates a new instance of Wishlist Item.
- image() : string
- Returns the Image
- itemNumber() : string
- Returns the Item Number
- productId() : int
- Returns the Product ID
- selectedOptions() : SelectedOptions
- Returns the Selected Options
- title() : string
- Returns the Title
- toArray() : array<string|int, mixed>
- Returns the contents of this Value Objects as an array
- wishlistItemId() : int
- Returns the Wishlist Item ID
- __construct() : mixed
- Constructor
Properties
$addedAt
private
DateTimeImmutable
$addedAt
$amount
private
int
$amount
$details
private
ItemDetails
$details
$productId
private
ProductId
$productId
$selectedOptions
private
SelectedOptions
$selectedOptions
$wishlistItemId
private
WishlistItemId
$wishlistItemId
Methods
addedAt()
Returns the Added Date
public
addedAt([string $format = "Y-m-d" ]) : string
Parameters
- $format : string = "Y-m-d"
Return values
string —amount()
Returns the Amount
public
amount() : int
Return values
int —create()
Creates a new instance of Wishlist Item.
public
static create(ProductId $productId, WishlistItemId $wishlistItemId, ItemDetails $details, int $amount, SelectedOptions $selectedOptions, DateTimeImmutable $addedAt) : self
Parameters
- $productId : ProductId
- $wishlistItemId : WishlistItemId
- $details : ItemDetails
- $amount : int
- $selectedOptions : SelectedOptions
- $addedAt : DateTimeImmutable
Return values
self —image()
Returns the Image
public
image() : string
Return values
string —itemNumber()
Returns the Item Number
public
itemNumber() : string
Return values
string —productId()
Returns the Product ID
public
productId() : int
Return values
int —selectedOptions()
Returns the Selected Options
public
selectedOptions() : SelectedOptions
Return values
SelectedOptions —title()
Returns the Title
public
title() : string
Return values
string —toArray()
Returns the contents of this Value Objects as an array
public
toArray([string $format = "Y-m-d" ]) : array<string|int, mixed>
Parameters
- $format : string = "Y-m-d"
Return values
array<string|int, mixed> —wishlistItemId()
Returns the Wishlist Item ID
public
wishlistItemId() : int
Return values
int —__construct()
Constructor
private
__construct(ProductId $productId, WishlistItemId $wishlistItemId, ItemDetails $details, int $amount, SelectedOptions $selectedOptions, DateTimeImmutable $addedAt) : mixed
Parameters
- $productId : ProductId
- $wishlistItemId : WishlistItemId
- $details : ItemDetails
- $amount : int
- $selectedOptions : SelectedOptions
- $addedAt : DateTimeImmutable