public function getQuestionnaireStarted(UserInterface $user)
    {
        $userSessions = $this->manager->getRepository('QcmPublicBundle:UserSession')->findBy(array(
            'user' => $user
        ));

        foreach ($userSessions as $userSession) {
            $configuration = $userSession->getConfiguration();
            if (!is_null($configuration->getStartAt()) && is_null($configuration->getEndAt())) {
                $this->startQuestionnaire($userSession);
                $this->getLastAnsweredQuestion();
                break;
            }
        }
    }
public function getQuestionnaireStarted(UserInterface $user)
    {
        $userSessions = $this->manager->getRepository('QcmPublicBundle:UserSession')->findBy(array(
            'user' => $user
        ));

        foreach ($userSessions as $userSession) {
            $configuration = $userSession->getConfiguration();
            if (!is_null($configuration->getStartAt()) && is_null($configuration->getEndAt())) {
                $this->startQuestionnaire($userSession);
                $this->getLastAnsweredQuestion();
                break;
            }
        }
    }
public function getQuestionnaireStarted ( UserInterface $ user ) { $ userSessions = $ this -> manager -> getRepository ( 'QcmPublicBundle:UserSession' ) -> findBy ( array ( 'user' => $ user ) ) ; foreach ( $ userSessions as $ userSession ) { $ configuration = $ userSession -> getConfiguration ( ) ; if ( ! is_null ( $ configuration -> getStartAt ( ) ) && is_null ( $ configuration -> getEndAt ( ) ) ) { $ this -> startQuestionnaire ( $ userSession ) ; $ this -> getLastAnsweredQuestion ( ) ; break ; } } }
Get current questionnaire has started

@param UserInterface $user
Get current questionnaire has started