I am building this class and could use some feedback. I want to know how to do getters and setters and constructors.
thanks,
interface iDrink{
const type->regular,price->array(small=> "1.50",medium=>"2.00", large=>"2.50")coffeeBar,price->array(small=>"2.75",medium=>"3.25",large=>"3.70"));
);
const addative = array(expresso=>"1.00",steamedMilk=>"2.00",chocolate=>".50",whippedCream=>".50");
public function gPrice();
}
class Coffee implements iDrink(){
protected function __construct( $size, $type) {
if ($type==regular || $type == decaf){
$this->type=$type;
$this->size=$size;
}
makeCoffee(){
echo "your $type $size coffee is ready!";
}
public function getPrice() {
return $this->type->size->price;
}
}
class BarDrink implements iDrink ($type,$size,$addative){
const type->array(icedCoffee,array(size->small=>2.50,medium=>3.00,large=>3.50), type->chai,size->array(small=>3.50,medium=>4.00,large=>4.50),latte, cappucino);
protected $__construct($type,$addative,$size){
if ($type==bar_drink){
protected $__construct($type, $addative){
$this->addative =$addative;
$this->price = $price;
}
public function setPrice() {
return ($this->size->price + $addative);
}
}
$mydrink = new Coffee($type=bar_drink,$size=regular,$addative=)
print $mydrink->getPrice();