This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Refactoring - inheritance question

Discussion around this tutorial for symfony 1.2-1.4

Refactoring - inheritance question

by ampo » Sat Aug 18, 2012 3:01 pm

Newbie question:

On day 6 of the Tutorial, in the 'Refactoring' section we add a method getActiveJobs() to the JobeetJobTable class.

Then we use the method in executeIndex() action, like this:
Code: Select all

public function executeIndex
(sfWebRequest $request)
  $this->jobeet_jobs = Doctrine_Core::getTable('JobeetJob')->getActiveJobs();

I works, but I wonder how?
As Doctrine_Core::getTable() returns an object type Doctrine_Table which shouldn't be aware of a method we added to JobeetJobTable class, yet it apparently does. As far as I know, Doctrine_Core doesn't inherit from Doctrine_Table, so it can't be plain inheritance. Could someone please explain how does it work?

Thanks in advance for any valuable explanation.
Junior Member
Posts: 2
Joined: Sat Aug 18, 2012 2:34 pm