/** * Get the survey id for this round * * @return int */ public function getSurvey() { if (false !== $this->_survey) { return $this->_survey; } $surveyId = $this->getSurveyId(); if ($surveyId) { $this->_survey = $this->tracker->getSurvey($surveyId); } else { $this->_survey = null; } return $this->_survey; }
/** * Load the survey object and use it */ protected function loadSurvey() { if (!$this->surveyList) { $this->addMessageInvalid($this->_('Survey insertion impossible: no insertable survey exists!')); } if (count($this->surveyList) === 1) { $model = $this->getModel(); $model->set('gto_id_survey', 'elementClass', 'Exhibitor'); reset($this->surveyList); $this->formData['gto_id_survey'] = key($this->surveyList); } if (isset($this->formData['gto_id_survey'])) { $this->survey = $this->tracker->getSurvey($this->formData['gto_id_survey']); $groupId = $this->survey->getGroupId(); $groups = $this->util->getDbLookup()->getGroups(); if (isset($groups[$groupId])) { $this->formData['ggp_name'] = $groups[$groupId]; } $this->formData['gto_valid_until'] = $this->survey->getInsertDateUntil($this->formData['gto_valid_from']); } }
/** * * @return \Gems_Tracker_Survey */ public function getSurvey() { if (!$this->survey) { $this->survey = $this->tracker->getSurvey($this->_gemsData['gto_id_survey']); } return $this->survey; }