When working through the Jobeet tutorial, I didn't do any testing on
the new method_for_query option/parameter added to the routing.yml
file on day 6. When test 2.3 failed in the jobActionsTest.php
functional test file on day 9, I was a little confused. I did a little
source digging, but was unable figure out the change necessary to make
sure the sfDoctrineRoute object used the appropriate query to look for
a job to show. Instead, I updated the executeShow() action in
actions.class.php in the job module. It now reads as follows...

public function executeShow(sfWebRequest $request){

//use new JobeetJobTable instance to retrieve an active job
$this->job = Doctrine::getTable('JobeetJob')->retrieveActiveJob
(Doctrine_Query::create()->from('JobeetJob j')->where('j.id = '.
$request->getParameter('id')));

//previous query that would show expired jobs
//$this->job = Doctrine::getTable('JobeetJob')->find($request-
>getParameter('id'));

$this->forward404Unless($this->job);

}

Is this a reasonable way to ensure that only jobs that have not
expired are shown? Are there alternative ways of making this work that
would be better?

For reference: http://trac.symfony-project.org/ticket/7026

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to