1 | <?php |
||
18 | class Pizza extends \Pizza |
||
19 | { |
||
20 | const |
||
21 | /** @var string DELIVERY designates that the delivery method is to deliver the pizza to the customer. */ |
||
22 | DELIVERY = 'delivery', |
||
23 | /** @var string PICKUP designates that the delivery method is that the customer picks the pizza up. */ |
||
24 | PICKUP = 'pickup'; |
||
25 | |||
26 | /** @var static contains the active instance for this Pizza. */ |
||
27 | static private $instance; |
||
28 | |||
29 | /** |
||
30 | * @var Pizza\Style $style |
||
31 | * @var Pizza\Sauce|null $sauce |
||
32 | * @var Pizza\Topping[] $toppings |
||
33 | */ |
||
34 | private $style, $sauce, $toppings; |
||
35 | |||
36 | /** |
||
37 | * The size of the pizza in centimeters, defaults to 20cm. |
||
38 | * |
||
39 | * @var int |
||
40 | */ |
||
41 | public $size = \Luigi\Pizza\SIZE_20CM; |
||
42 | |||
43 | var $legacy; // don't use this anymore! |
||
44 | |||
45 | protected |
||
46 | /** @var string $packaging The type of packaging for this Pizza */ |
||
47 | $packaging = self::PACKAGING, |
||
48 | /** @var string $deliveryMethod Is the customer picking this pizza up or must it be delivered? */ |
||
49 | $deliveryMethod; |
||
50 | |||
51 | private function __construct(Pizza\Style $style) |
||
55 | |||
56 | /** |
||
57 | * Creates a new instance of a Pizza. |
||
58 | * |
||
59 | * This method can be used to instantiate a new object of this class which can then be retrieved using |
||
60 | * {@see self::getInstance()}. |
||
61 | * |
||
62 | * @param Pizza\Style $style |
||
63 | * |
||
64 | * @see self::getInstance to retrieve the pizza object. |
||
65 | * |
||
66 | * @return void |
||
67 | */ |
||
68 | public static function createInstance(Pizza\Style $style) |
||
72 | |||
73 | /** |
||
74 | * @return self |
||
75 | */ |
||
76 | static function getInstance() |
||
80 | |||
81 | final public function setSauce(Pizza\Sauce $sauce) |
||
85 | |||
86 | final public function addTopping(Pizza\Topping $topping) |
||
90 | |||
91 | public function setSize(&$size = \Luigi\Pizza\SIZE_20CM) |
||
94 | |||
95 | public function getPrice() |
||
98 | } |
||
99 |