Pizza
extends AbstractProduct
in package
implements
ProductInterface, JsonSerializable
Uses
ReviewableTrait
A pizza.
Interfaces, Classes, Traits and Enums
- ProductInterface
- Interface for a product.
- JsonSerializable
Table of Contents
- $reviews : array<string|int, mixed>
- $base : Base|null
- Pizza base.
- $price : float
- Product price.
- $name : string
- Product name.
- __construct() : mixed
- getName() : string
- Get the name of the product.
- getPrice() : float
- Get the price of the product.
- getTaxRate() : float
- Get the tax rate for the product.
- isReviewed() : bool
- Whether the object has been reviewed.
- jsonSerialize() : mixed
Properties
$reviews
public
static array<string|int, mixed>
$reviews
= []
Product reviews.
$base
Pizza base.
protected
Base|null
$base
$price
Product price.
protected
float
$price
$name
Product name.
private
string
$name
Methods
__construct()
public
__construct(string $name, float $price[, Base|null $base = null ]) : mixed
Parameters
- $name : string
-
Product name.
- $price : float
-
Product price.
- $base : Base|null = null
-
Pizza base.
Return values
mixed —getName()
Get the name of the product.
public
getName() : string
Return values
string —The name of the product.
getPrice()
Get the price of the product.
public
getPrice() : float
Return values
float —getTaxRate()
Get the tax rate for the product.
public
getTaxRate() : float
Return values
float —isReviewed()
Whether the object has been reviewed.
public
isReviewed() : bool
Return values
bool —jsonSerialize()
public
jsonSerialize() : mixed