Pizza
extends Pizza
in package
uses
ExampleNestedTrait
Pizza base class
Attributes
- #[Food]
- "Pizza"
- #[Food]
- $country: "Italy"
- $originDate: \Luigi\Pizza::class
Table of Contents
Constants
- DELIVERY = 'delivery'
- PACKAGING = 'box'
- The packaging method used to transport the pizza.
- PICKUP = 'pickup'
Properties
- $legacy : mixed
- $size : int
- The size of the pizza in centimeters, defaults to 20cm.
- $deliveryMethod : string
- $packaging : string
- $instance : static
- $sauce : Sauce|null
- $style : Style
- $toppings : array<string|int, Topping>
Methods
- addTopping() : mixed
- createInstance() : void
- Creates a new instance of a Pizza.
- getInstance() : self
- getPrice() : mixed
- setSauce() : mixed
- setSize() : mixed
- __construct() : mixed
- exampleTraitMethod() : mixed
Constants
DELIVERY
public
string
DELIVERY
= 'delivery'
DELIVERY designates that the delivery method is to deliver the pizza to the customer.
PACKAGING
The packaging method used to transport the pizza.
public
mixed
PACKAGING
= 'box'
PICKUP
public
string
PICKUP
= 'pickup'
PICKUP designates that the delivery method is that the customer picks the pizza up.
Properties
$legacy
public
mixed
$legacy
$size
The size of the pizza in centimeters, defaults to 20cm.
public
int
$size
= \Luigi\Pizza\SIZE_20CM
$deliveryMethod
protected
string
$deliveryMethod
Is the customer picking this pizza up or must it be delivered?
$packaging
protected
string
$packaging
= self::PACKAGING
The type of packaging for this Pizza
$instance
private
static static
$instance
contains the active instance for this Pizza.
$sauce
private
Sauce|null
$sauce
$style
private
Style
$style
$toppings
private
array<string|int, Topping>
$toppings
Methods
addTopping()
public
final addTopping(Topping $topping) : mixed
Parameters
- $topping : Topping
createInstance()
Creates a new instance of a Pizza.
public
static createInstance(Style $style) : void
This method can be used to instantiate a new object of this class which can then be retrieved using self::getInstance().
Parameters
- $style : Style
Tags
getInstance()
public
static getInstance() : self
Return values
selfgetPrice()
public
getPrice() : mixed
setSauce()
public
final setSauce(Sauce $sauce) : mixed
Parameters
- $sauce : Sauce
setSize()
public
setSize([mixed &$size = SIZE_20CM ]) : mixed
Parameters
- $size : mixed = SIZE_20CM
__construct()
private
__construct(Style $style[, Sauce|null $sauce = null ]) : mixed
Parameters
exampleTraitMethod()
private
exampleTraitMethod() : mixed