how can i get number ID in action? for example
class jobActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
$this->jobeet_jobs = Doctrine::getTable('JobeetJob')
->createQuery('a')
->where('id = 3')
->execute();
echo $this->jobeet_jobs->getId(); //doesnt work
}
public function executeTest(sfWebRequest $request)
{
$this->id = $this->jobeet_jobs->getId(); /doesnt work
}
}
As execute returns an array of objects, you either need to iterate through them recieving the ids or you use
$this->jobeet_jobs = Doctrine::getTable('JobeetJob')->createQuery('a')
->where('id = 3')
->fetchOne();