src/Google/AdsApi/AdWords/Query/v201809/ServiceQueryBuilderDelegate.php
public function select(array $fields)
    {
        if (empty($fields)) {
            throw new InvalidArgumentException('The field array must not be' .
                ' empty.');
        }

        foreach ($fields as $field) {
            $validationResult = QueryValidator::validateFieldName($field);
            if ($validationResult->isFailed()) {
                throw new InvalidArgumentException('The field array for' .
                    ' building the SELECT clause contains invalid field name.' .
                    ' Validation fail reason: ' .
                    $validationResult->getFailReason());
            }
        }

        // Flipping an array will create a new associative array. The keys of
        // the new associative array make a set of distinct fields.
        $distinctFields = array_flip($fields);
        $this->selectFields = array_keys($distinctFields);
    }
public function select(array $fields)
    {
        if (empty($fields)) {
            throw new InvalidArgumentException('The field array must not be' .
                ' empty.');
        }

        foreach ($fields as $field) {
            $validationResult = QueryValidator::validateFieldName($field);
            if ($validationResult->isFailed()) {
                throw new InvalidArgumentException('The field array for' .
                    ' building the SELECT clause contains invalid field name.' .
                    ' Validation fail reason: ' .
                    $validationResult->getFailReason());
            }
        }

        // Flipping an array will create a new associative array. The keys of
        // the new associative array make a set of distinct fields.
        $distinctFields = array_flip($fields);
        $this->selectFields = array_keys($distinctFields);
    }
public function select ( array $ fields ) { if ( empty ( $ fields ) ) { throw new InvalidArgumentException ( 'The field array must not be' . ' empty.' ) ; } foreach ( $ fields as $ field ) { $ validationResult = QueryValidator :: validateFieldName ( $ field ) ; if ( $ validationResult -> isFailed ( ) ) { throw new InvalidArgumentException ( 'The field array for' . ' building the SELECT clause contains invalid field name.' . ' Validation fail reason: ' . $ validationResult -> getFailReason ( ) ) ; } } // Flipping an array will create a new associative array. The keys of // the new associative array make a set of distinct fields. $ distinctFields = array_flip ( $ fields ) ; $ this -> selectFields = array_keys ( $ distinctFields ) ; }
Sets the fields for the SELECT clause. Repeated field names will be
included exactly once.

@param array $fields the fields for building the SELECT clause
Sets the fields for the SELECT clause . Repeated field names will be included exactly once .