public function getEmail()
    {
        // If staff, return null, we don't know who to email
        if ($this->getSurvey()->isTakenByStaff()) {
            return null;
        }

        // If we have a relation, return that address
        if ($this->hasRelation()) {
            if ($relation = $this->getRelation()) {
                return $relation->getEmail();
            }

            return null;
        }

        // It can only be the respondent
        return $this->getRespondent()->getEmailAddress();
    }
public function getEmail()
    {
        // If staff, return null, we don't know who to email
        if ($this->getSurvey()->isTakenByStaff()) {
            return null;
        }

        // If we have a relation, return that address
        if ($this->hasRelation()) {
            if ($relation = $this->getRelation()) {
                return $relation->getEmail();
            }

            return null;
        }

        // It can only be the respondent
        return $this->getRespondent()->getEmailAddress();
    }
public function getEmail ( ) { // If staff, return null, we don't know who to email if ( $ this -> getSurvey ( ) -> isTakenByStaff ( ) ) { return null ; } // If we have a relation, return that address if ( $ this -> hasRelation ( ) ) { if ( $ relation = $ this -> getRelation ( ) ) { return $ relation -> getEmail ( ) ; } return null ; } // It can only be the respondent return $ this -> getRespondent ( ) -> getEmailAddress ( ) ; }
Get the email address of the person who needs to fill out this survey.

This method will return null when no address available

@return string|null Email address of the person who needs to fill out the survey or null
Get the email address of the person who needs to fill out this survey .