CustomerOrder
in package
Class CustomerOrder
Table of Contents
- $customerId : CustomerId
- $orderDate : DateTimeImmutable
- $orderId : OrderId
- $orderStatus : OrderStatus
- $paymentMethod : string
- $productIds : ProductIds
- $shippingCountry : string
- $totalAmount : float
- create() : CustomerOrder
- customerId() : int
- orderDate() : string
- orderId() : int
- paymentMethod() : string
- productIds() : ProductIds
- shippingCountry() : string
- toArray() : array<string|int, mixed>
- totalAmount() : float
- __construct() : mixed
Properties
$customerId
private
CustomerId
$customerId
$orderDate
private
DateTimeImmutable
$orderDate
$orderId
private
OrderId
$orderId
$orderStatus
private
OrderStatus
$orderStatus
$paymentMethod
private
string
$paymentMethod
$productIds
private
ProductIds
$productIds
$shippingCountry
private
string
$shippingCountry
$totalAmount
private
float
$totalAmount
Methods
create()
public
static create(OrderId $orderId, CustomerId $customerId, ProductIds $productIds, DateTimeImmutable $orderDate, OrderStatus $orderStatus, float $totalAmount, string $shippingCountry, string $paymentMethod) : CustomerOrder
Parameters
- $orderId : OrderId
- $customerId : CustomerId
- $productIds : ProductIds
- $orderDate : DateTimeImmutable
- $orderStatus : OrderStatus
- $totalAmount : float
- $shippingCountry : string
- $paymentMethod : string
Return values
CustomerOrder —customerId()
public
customerId() : int
Return values
int —orderDate()
public
orderDate([string $datetimeFormat = 'Y-m-d H:i:s' ]) : string
Parameters
- $datetimeFormat : string = 'Y-m-d H:i:s'
Return values
string —orderId()
public
orderId() : int
Return values
int —paymentMethod()
public
paymentMethod() : string
Return values
string —productIds()
public
productIds() : ProductIds
Return values
ProductIds —shippingCountry()
public
shippingCountry() : string
Return values
string —toArray()
public
toArray([string $datetimeFormat = 'Y-m-d H:i:s' ]) : array<string|int, mixed>
Parameters
- $datetimeFormat : string = 'Y-m-d H:i:s'
Return values
array<string|int, mixed> —totalAmount()
public
totalAmount() : float
Return values
float —__construct()
private
__construct(OrderId $orderId, CustomerId $customerId, ProductIds $productIds, DateTimeImmutable $orderDate, OrderStatus $orderStatus, float $totalAmount, string $shippingCountry, string $paymentMethod) : mixed
Parameters
- $orderId : OrderId
- $customerId : CustomerId
- $productIds : ProductIds
- $orderDate : DateTimeImmutable
- $orderStatus : OrderStatus
- $totalAmount : float
- $shippingCountry : string
- $paymentMethod : string