Pizza
in package
implements
Product
uses
SharedTrait
Table of Contents
Interfaces
- Product
- Contract between products.
Constants
- MY_CONSTANT = 'A'
- TYPE_ITALIAN = 'italian'
- TYPE_AMERICAN = 'american'
- Not a real pizza.
- TYPE_HYBRID = ['italian,spanish', 1, 'american']
Properties
- $asymmetric : string
- $base : string
- Demonstrates hook inheritance from a parent class.
- $cookingTime : int
- Property with default value.
- $description : string
- $ingredients : array<string|int, string>
- The ingredients array for the pizza.
- $instructions : string
- Special instructions for preparing the pizza.
- $moisture : float
- Returns the moisture of the pizza.
- $name : string
- Name of your own custom Pizza.
- $pizzeria : object
- Reference to the pizzeria this pizza belongs to.
- $price : float
- Price of the pizza.
- $size : string
- Size of the pizza (small, medium, large).
- $temperature : float
- This is a virtual property.
- $toppingCount : int
- Number of toppings on the pizza.
- $extra : ArrayObject
- I don't know what this does; can we delete this?
- $sharedProperty : string
- $alwaysTrue : true
- $property1 : float
- Properties for NewTest.
- $property2 : float
- Properties for NewTest.
- $property3 : float
- Properties for NewTest.
- $secretIngredient : mixed
- The best part of a Pizza is its secret ingredient.
- $secretProperty : bool
Methods
- eatIt() : void
- Om nom nom.
- getName() : string
- Returns the name to be displayed on the product listing.
- sayHello() : Base
Constants
MY_CONSTANT
public
mixed
MY_CONSTANT
= 'A'
TYPE_ITALIAN
public
mixed
TYPE_ITALIAN
= 'italian'
TYPE_AMERICAN
Not a real pizza.
protected
final string
TYPE_AMERICAN
= 'american'
Does not need much more of an explanation, does it? ;)
TYPE_HYBRID
private
mixed
TYPE_HYBRID
= ['italian,spanish', 1, 'american']
Properties
$asymmetric
public private(set)
string
$asymmetric
$base read-only virtual
Demonstrates hook inheritance from a parent class.
public
string
$base
Hooks
public
string
get
$cookingTime virtual
Property with default value.
public
int
$cookingTime
This property has a default value when accessed for the first time.
Hooks
public
int
get
public
set
Parameters
- $value : int
$description
public
static string
$description
= ''
$ingredients virtual
The ingredients array for the pizza.
public
array<string|int, string>
$ingredients
This demonstrates property hooks with arrays.
Hooks
public
array<string|int, string>
get
public
set
Parameters
- $value : array<string|int, mixed>
$instructions write-only virtual
Special instructions for preparing the pizza.
public
string
$instructions
This is a write-only property that can only be set, not read. It demonstrates the write-only property hook pattern.
Hooks
public
set
Parameters
- $value : string
$moisture virtual
Returns the moisture of the pizza.
public private(set)
float
$moisture
This property is used to determine how moist the pizza is, which can affect the overall taste and texture.
Hooks
public
float
get
value is calculated during the time in the oven.
Description
private
set
Parameters
- $value : int|float
$name read-only
Name of your own custom Pizza.
public
string
$name
= ''
Want to show to your friends how cool your pizza baking skills are? Now you can! Name your Pizza anything you want and stun them with your awesome creativity!
$pizzeria virtual
Reference to the pizzeria this pizza belongs to.
public
object
$pizzeria
Demonstrates property hooks with references.
Hooks
public
object
get
public
set
Parameters
- $value : mixed
$price
Price of the pizza.
public
float
$price
= 0.0
This is a non-virtual property with hooks and formatting.
Hooks
public
float
get
public
set
Parameters
- $value : float
$size
Size of the pizza (small, medium, large).
public
string
$size
= 'medium'
This is a non-virtual property with hooks and custom validation.
Hooks
public
string
get
public
set
Parameters
- $value : string
$temperature read-only virtual
This is a virtual property.
public
float
$temperature
phpDocumentor should display this as a read-only property, even though it is not defined as such.
Hooks
public
float
get
$toppingCount
Number of toppings on the pizza.
public
int
$toppingCount
= 0
This is a non-virtual property with hooks. It uses the same name for backing field.
Hooks
public
int
get
public
set
Parameters
- $value : int
$extra
I don't know what this does; can we delete this?
protected
ArrayObject
$extra
$sharedProperty
protected
string
$sharedProperty
$alwaysTrue
private
true
$alwaysTrue
= true
$property1
Properties for NewTest.
private
float
$property1
OneProp
$property2
Properties for NewTest.
private
float
$property2
TwoProp
$property3
Properties for NewTest.
private
float
$property3
$secretIngredient
The best part of a Pizza is its secret ingredient.
private
mixed
$secretIngredient
Even the type of this is secret!
$secretProperty
private
bool
$secretProperty
Methods
eatIt()
Om nom nom.
public
eatIt() : void
What else do you do with a pizza? Put it in your freezer?
Attributes
- #[Route]
- '/very/cool/route/{foo}/{bar}'
- $name: 'very_cool_route'
- $defaults: ['foo' => 'foo', 'bar' => 'bar']
getName()
Returns the name to be displayed on the product listing.
public
getName() : string
Return values
string —the name of this product.
sayHello()
public
sayHello() : Base