I have this class:
abstract class Hotel
{
protected $util;
function __construct()
{
$this->util = new Utility();
}
function add(Validate $data, Model_Hotel $hotel){}
function delete(){}
function upload_image(array $imagedetails, $hotel_id){}
}
and a class that extends it
class Premium extends Hotel
{
function add(Model_Hotel $hotel)
{
$hotel->values;
$hotel->save();
}
function upload_image(array $imagedetails, $hotel_id)
{
$this->util->save_image($imagedetails, $hotel_id);
}
}
but then I get an error:
"declaration of Premium::add must be compatible with Hotel::add"
as you can see, I left out a parameter for the add() method, which was intentional
what OOP facility would allow me to inherit a function whose parameters I can change? (Obviously an abstract class won't do here)