public function getQuestionsCount() { return TraitementAgentTable::getInstance()->createQuery('t') ->select('COUNT(t.id_traitement_agent)') ->where('t.id_qualif_agent is NULL') ->andWhere('t.id_agent = ?', $this->getLoggedUserId()) ->fetchOne(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR); }
public function executeNextQuestionPartial(sfWebRequest $request) { $nextQuestion = TraitementAgentTable::getInstance()->createQuery('t') ->where('t.id_qualif_agent is NULL') ->andWhere('t.id_agent = ?', $this->getUser()->getLoggedUserId()) ->orderBy('t.date_creation ASC') ->fetchOne(); if ($nextQuestion) { $this->questionForm = new QuestionForm($nextQuestion->getQuestion()); $this->traitementAgentForm = new TraitementAgentForm($nextQuestion); return $this->renderPartial('agentQuestion', array( 'questionForm' => $this->questionForm, 'traitementAgentForm' => $this->traitementAgentForm )); } }