public function endQuestionnaire(\DateTime $endDate = null)
    {
        $configuration = $this->getUserConfiguration();

        if (is_null($configuration->getEndAt())) {
            $now = new \DateTime();

            if (!is_null($endDate)) {
                $now = $endDate;
            }

            $configuration = $this->getUserConfiguration();
            $configuration->setEndAt($now);

            $this->updateSessionConfiguration()
                ->clearQuestionnaire();
        }

        return $this;
    }
public function endQuestionnaire(\DateTime $endDate = null)
    {
        $configuration = $this->getUserConfiguration();

        if (is_null($configuration->getEndAt())) {
            $now = new \DateTime();

            if (!is_null($endDate)) {
                $now = $endDate;
            }

            $configuration = $this->getUserConfiguration();
            $configuration->setEndAt($now);

            $this->updateSessionConfiguration()
                ->clearQuestionnaire();
        }

        return $this;
    }
public function endQuestionnaire ( \ DateTime $ endDate = null ) { $ configuration = $ this -> getUserConfiguration ( ) ; if ( is_null ( $ configuration -> getEndAt ( ) ) ) { $ now = new \ DateTime ( ) ; if ( ! is_null ( $ endDate ) ) { $ now = $ endDate ; } $ configuration = $ this -> getUserConfiguration ( ) ; $ configuration -> setEndAt ( $ now ) ; $ this -> updateSessionConfiguration ( ) -> clearQuestionnaire ( ) ; } return $ this ; }
End current questionnaire

@param null|\DateTime $endDate

@return $this
End current questionnaire