protected function setFields($fields)
    {
        if(is_array($fields)) {
            foreach ( $fields as $field ) {
                if ( !in_array($field, $this->fieldsWhitelist) ) {
                    throw new \InvalidArgumentException(sprintf('The field `%s` was not recognized.', $field));
                }
            }
        } elseif($fields === true) {
            $fields = $this->fieldsWhitelist;
        } else {
            throw new \InvalidArgumentException("The argument passed to setFields was invalid");
        }

        $this->setQueryParam('fields', $fields);
    }
protected function setFields($fields)
    {
        if(is_array($fields)) {
            foreach ( $fields as $field ) {
                if ( !in_array($field, $this->fieldsWhitelist) ) {
                    throw new \InvalidArgumentException(sprintf('The field `%s` was not recognized.', $field));
                }
            }
        } elseif($fields === true) {
            $fields = $this->fieldsWhitelist;
        } else {
            throw new \InvalidArgumentException("The argument passed to setFields was invalid");
        }

        $this->setQueryParam('fields', $fields);
    }
protected function setFields ( $ fields ) { if ( is_array ( $ fields ) ) { foreach ( $ fields as $ field ) { if ( ! in_array ( $ field , $ this -> fieldsWhitelist ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The field `%s` was not recognized.' , $ field ) ) ; } } } elseif ( $ fields === true ) { $ fields = $ this -> fieldsWhitelist ; } else { throw new \ InvalidArgumentException ( "The argument passed to setFields was invalid" ) ; } $ this -> setQueryParam ( 'fields' , $ fields ) ; }
Set profile fields to be fetched

@param array $fields Fields

@return void
Set profile fields to be fetched