Documentation

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.

Methods

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
see
self::getInstance

to retrieve the pizza object.

getInstance()

public static getInstance() : self
Return values
self

getPrice()

public getPrice() : mixed

setSauce()

public final setSauce(Sauce $sauce) : mixed
Parameters
$sauce : Sauce

__construct()

private __construct(Style $style[, Sauce|null $sauce = null ]) : mixed
Parameters
$style : Style
$sauce : Sauce|null = null

        
On this page

Search results