public function getRespondentFields($requests)
    {
        $token   = $this->token;
        $results = [];

        $respondent = $token->getRespondent();

        foreach ($requests as $original => $upperField) {
            switch ($upperField) {
                case 'AGE':
                    $results[$original] = $respondent->getAge();
                    break;

                case 'SEX':
                    $results[$original] = $respondent->getGender();
                    break;

                case 'BIRTHDATE':
                    $birthDate = $respondent->getBirthday();
                    if (!is_null($birthDate) && $birthDate instanceof \MUtil_Date) {
                        $birthDate          = $birthDate->get('yyyy-MM-dd');
                        $results[$original] = $birthDate;
                    }
                    break;

                default:
                    break;
            }
        }

        return $results;
    }
public function getRespondentFields($requests)
    {
        $token   = $this->token;
        $results = [];

        $respondent = $token->getRespondent();

        foreach ($requests as $original => $upperField) {
            switch ($upperField) {
                case 'AGE':
                    $results[$original] = $respondent->getAge();
                    break;

                case 'SEX':
                    $results[$original] = $respondent->getGender();
                    break;

                case 'BIRTHDATE':
                    $birthDate = $respondent->getBirthday();
                    if (!is_null($birthDate) && $birthDate instanceof \MUtil_Date) {
                        $birthDate          = $birthDate->get('yyyy-MM-dd');
                        $results[$original] = $birthDate;
                    }
                    break;

                default:
                    break;
            }
        }

        return $results;
    }
public function getRespondentFields ( $ requests ) { $ token = $ this -> token ; $ results = [ ] ; $ respondent = $ token -> getRespondent ( ) ; foreach ( $ requests as $ original => $ upperField ) { switch ( $ upperField ) { case 'AGE' : $ results [ $ original ] = $ respondent -> getAge ( ) ; break ; case 'SEX' : $ results [ $ original ] = $ respondent -> getGender ( ) ; break ; case 'BIRTHDATE' : $ birthDate = $ respondent -> getBirthday ( ) ; if ( ! is_null ( $ birthDate ) && $ birthDate instanceof \ MUtil_Date ) { $ birthDate = $ birthDate -> get ( 'yyyy-MM-dd' ) ; $ results [ $ original ] = $ birthDate ; } break ; default : break ; } } return $ results ; }
Tries to fulfill request to respondent fields

@param array $requests
@return array
Tries to fulfill request to respondent fields