class MyHumbleBaseClass {
function getDateParam($format="Y-m-d h:m:s") {$timestamp = ....
if ($format==null) return $timestamp;
else return $this->formattedDate($format);
}
}
2. Override it in some derived class like that:
class MyHumbleDerivedClass {function getDateParam() {
return MyHumbleBaseClass::getDateParam();
}
}
3. To add some extra twist, forget that the default format is not null, and do things like that:
if ($derivedObject->getDateParam()<$timestamp) {4. Enjoy.
// think that it should work
}
PS In fact, simple overriding will probably not be enough; if you supply the parameters, you will end up calling the parent function. But if you use the base method as a strategy from within your other class, thus shielding the direct access to the base class completely, then the success is practically guaranteed.