Get the respondent object

@return \Gems_Tracker_Respondent
6593
public function getRespondent()
    {
        if (! $this->_respondent instanceof \Gems_Tracker_Respondent) {
            if ($this->_getParam(\MUtil_Model::REQUEST_ID1) && $this->_getParam(\MUtil_Model::REQUEST_ID2)) {
                $this->_respondent = parent::getRespondent();

            } else {
                $id = $this->_getParam(\MUtil_Model::REQUEST_ID);

                if ($id) {
                    $model = $this->getModel();
                    $row = $model->loadFirst(array('grco_id_action' => $id));

                    if ($row) {
                        $this->_respondent = $this->loader->getRespondent(
                                $row['gr2o_patient_nr'],
                                $row['gr2o_id_organization']
                                );

                        if (! $this->_respondent->exists) {
                            throw new \Gems_Exception($this->_('Unknown respondent.'));
                        }

                        $this->_respondent->applyToMenuSource($this->menu->getParameterSource());
                    }
                }
            }
        }

        return $this->_respondent;
    }
185362
public function getTrackEngine()
    {
        static $engine;

        if ($engine instanceof \Gems_Tracker_Engine_TrackEngineInterface) {
            return $engine;
        }

        try {
            $respTrack = $this->getRespondentTrack();
            if ($respTrack instanceof \Gems_Tracker_RespondentTrack) {
                $engine = $respTrack->getTrackEngine();
            }

        } catch (\Exception $ex) {
        }

        if (! $engine instanceof \Gems_Tracker_Engine_TrackEngineInterface) {
            $trackId = $this->_getParam(\Gems_model::TRACK_ID);

            if (! $trackId) {
                if ($this->isMultiTracks()) {
                    throw new \Gems_Exception($this->_('No track engine specified!'));
                }

                $trackId = $this->escort->getTrackId();

                if (! $trackId) {
                    return null;
                }
            }

            $engine = $this->loader->getTracker()->getTrackEngine($trackId);
        }
        $engine->applyToMenuSource($this->menu->getParameterSource());

        return $engine;
    }
762994
public function getResponse()
    {
        if (null === ($response = $this->_response)) {
            require_once 'Zend/Amf/Response/Http.php';
            $this->setResponse(new Zend_Amf_Response_Http());
        }
        return $this->_response;
    }
302413
protected function getImportTranslator()
    {
        $translator = parent::getImportTranslator();

        if ($translator instanceof \Gems_Model_Translator_AnswerTranslatorAbstract) {
            // Set answer specific options
            $surveyId = isset($this->formData['survey']) ? $this->formData['survey'] : null;
            $tokenCompleted = isset($this->formData['tokenCompleted']) ?
                    $this->formData['tokenCompleted'] :
                    \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR;
            $skipUnknownPatients = isset($this->formData['skipUnknownPatients']) &&
                    $this->formData['skipUnknownPatients'];
            $noToken = isset($this->formData['noToken']) ?
                    $this->formData['noToken'] :
                    \Gems_Model_Translator_AnswerTranslatorAbstract::TOKEN_ERROR;

            $trackId = isset($this->formData['track']) ? $this->formData['track'] : null;

            $translator->setSurveyId($surveyId);
            $translator->setSkipUnknownPatients($skipUnknownPatients);
            $translator->setTokenCompleted($tokenCompleted);
            $translator->setNoToken($noToken);
            $translator->setTrackId($trackId);
        }

        return $translator;
    }
1155739
protected function createModel()
    {
        if (! $this->model instanceof \Gems_Model_RespondentModel) {
            $this->model = $this->loader->getModels()->createRespondentModel();
            $this->model->applyBrowseSettings();
        }
        return $this->model;
    }
648468
public function processChangedRespondent(\Gems_Tracker_Respondent $respondent)
    {
        $changes    = 0;
        $tracker    = $this->loader->getTracker();
        $respTracks = $tracker->getRespondentTracks($respondent->getId(), $respondent->getOrganizationId());
        $userId     = $this->currentUser->getUserId();

        $tracksData = $this->db->fetchAll("SELECT * FROM gems__tracks
            WHERE gtr_active = 1 AND
                CONCAT(' ', gtr_code, ' ') LIKE '% " . $this->trackCode . " %' AND
                gtr_organizations LIKE '%|" . $respondent->getOrganizationId() . "|%'
            ORDER BY gtr_track_name");

        // \MUtil_Echo::track($tracksData);

        $changes = false;

        foreach ($tracksData as $trackData) {
            $trackEngine = $tracker->getTrackEngine($trackData);
            if ($trackEngine instanceof \Gems_Tracker_Engine_TrackEngineInterface) {
                // \MUtil_Echo::track($trackEngine->getTrackCode(), count($respTracks));

                $create = true;
                foreach($respTracks as $respondentTrack) {
                    if (($respondentTrack instanceof \Gems_Tracker_RespondentTrack) &&
                            ($respondentTrack->getTrackId() == $trackEngine->getTrackId())) {
                        $create = false;
                        break;
                    }
                }

                // \MUtil_Echo::track($create);
                if ($create) {
                    $changes = true;
                    $tracker->createRespondentTrack(
                            $respondent->getId(),
                            $respondent->getOrganizationId(),
                            $trackEngine->getTrackId(),
                            $userId
                            );
                }
            }
        }

        return $changes;
    }
1310382
public function getSender()
    {
        $sender = $this->createSender();

        $sender->setFrom($this->fromEmail, $this->fromName);

        if ($this->replyToEmail) {
            $sender->setReplyTo($this->replyToEmail);
        }

        return $sender;
    }
178933
public function getResponse() {
		$l = $this->action->layout('output');
		
		switch($l) {
			case 'object':
			case 'object_list':
			case 'hash':
			case 'hash_list':
				return $this->envelope->response->{$this->action->getNamespace('output')};
				
			default:
				return $this->envelope->response;
		}
	}
779917
public function replyTo()
    {
        if ($this->replyTo === null) {
            $this->replyTo = $this->config()->defaultReplyTo();
        }

        return $this->replyTo;
    }
199340
public function getParsedResponse()
    {
        // We first get an array representing the response
        $rawData = $this->bodyToArray();

        // If we have a wrapper response object initialized in the current ActionResponse object, then we return it.
        if ($this->responseWrapper instanceof Wrapper\ResponseWrapperInterface) {
            $this->responseWrapper->init($rawData, $this);
            return $this->responseWrapper;
        }
        return $rawData;
    }
922935
public function getResponse()
    {
        $this->isRateLimitReached();
        $this->isAccessTokenPresent();
        $oauth = $this->instagram->getOAuth();

        if (!$oauth->isAccessTokenSet()) {
            $oauth->setAccessToken($this->params['access_token']);
        }

        $this->execute();

        return $this->response;
    }
779895
public function getResponseObject()
    {
        if (empty($this->responseObject)) {
            $this->responseObject = $this->convertResponseBodyToObject(
                $this->restDriver->getBody(),
                $this->restDriver->getHeader('content-type')
            );
        }

        return $this->responseObject;
    }
136845
public function getResponse()
    {
        if ($this->response === null and $this->isExecuted()) {
            $this->response = Response::forge($this);
        }

        return $this->response;
    }
706438
protected function getUnauthorizedResponse()
    {
        $authHeaderValue = $this->realm === null ? static::AUTHENTICATION_SCHEME :
            static::AUTHENTICATION_SCHEME . ' realm="' . $this->realm . '"';

        return $this->integration->createResponse(
            null,
            Response::HTTP_UNAUTHORIZED,
            [self::HEADER_WWW_AUTHENTICATE => $authHeaderValue]
        );
    }
757227
public function getContactSubject()
    {
        if ($this->_sContactSubject === null) {
            $this->_sContactSubject = Registry::getConfig()->getRequestParameter('c_subject');
        }

        return $this->_sContactSubject;
    }
570988
public function getChildrenAction()
    {
        $id = $this
            ->request
            ->query
            ->get('id');

        return $this->createResponseObject(function () use ($id) {
            return $this->normalizeLocationDataArray(
                $this
                    ->locationProvider
                    ->getChildren($id)
            );
        });
    }
880823
protected function getTrackTitle()
    {
        $respondent  = $this->getRespondent();
        $respTrack   = $this->getRespondentTrack();
        if ($respTrack) {
            $trackEngine = $respTrack->getTrackEngine();

            if ($this->currentUser->areAllFieldsMaskedWhole('grs_first_name', 'grs_surname_prefix', 'grs_last_name')) {
                // Set params
                return sprintf(
                        $this->_('%s track for respondent nr %s'),
                        $trackEngine->getTrackName(),
                        $respondent->getPatientNumber()
                        );
            }

            // Set params
            return sprintf(
                    $this->_('%s track for respondent nr %s: %s'),
                    $trackEngine->getTrackName(),
                    $respondent->getPatientNumber(),
                    $respondent->getName()
                    );
        }
    }