I have a class called Report. I have several classes that inherit from the report, ClientReport, ClientVisitReport ...
class Report { ... public function load($id) { ... } } class ClientReport extends Report { ... public function load($id) { parent::load($id); ... } } class ClientVisitReport extends Report { ... public function load($id) { parent::load($id); ... } }
I want to be able to call the correct constructor from the identifier that I pass to the load method. Each identifier has its own report.
Basically I ask how can I do this:
$reportObject = new Report();
How can I do it? Maybe I'm wrong in my design, is there a better way to do what I want?
kevin source share