\Google\AdsApi\AdWords\Query\v201809ServiceQueryBuilderDelegate

A delegate of `ServiceQueryBuilder`, which shouldn't be used directly.

Use ServiceQueryBuilder to build a ServiceQuery object.

Summary

Methods
Properties
Constants
copyFrom()
select()
where()
orderByAsc()
orderByDesc()
limit()
build()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
orderBy()
buildSelectClause()
appendWhereClause()
appendOrderByClause()
$startIndex
$pageSize
$orderByFields
$selectFields
$whereBuilders
N/A

Properties

$startIndex

$startIndex :

Type

$pageSize

$pageSize :

Type

$orderByFields

$orderByFields :

Type

$selectFields

$selectFields :

Type

Methods

copyFrom()

copyFrom(\Google\AdsApi\AdWords\Query\v201809\ServiceQueryBuilderDelegate  $otherInstance,\Google\AdsApi\AdWords\Query\v201809\ServiceQueryBuilder  $queryBuilder): \Google\AdsApi\AdWords\Query\v201809\ServiceQueryBuilderDelegate

Creates a new query builder delegate object by copying field names, WHERE conditions and pagination data from another query builder delegate object.

Parameters

\Google\AdsApi\AdWords\Query\v201809\ServiceQueryBuilderDelegate $otherInstance

the other query builder delegate object for copying field names, WHERE conditions and pagination data

\Google\AdsApi\AdWords\Query\v201809\ServiceQueryBuilder $queryBuilder

the query builder object for continuation of building a complete AWQL string

Returns

\Google\AdsApi\AdWords\Query\v201809\ServiceQueryBuilderDelegate

a new query builder delegate object that copies from the input one

select()

select(array  $fields)

Sets the fields for the SELECT clause. Repeated field names will be included exactly once.

Parameters

array $fields

the fields for building the SELECT clause

where()

where(string  $field,\Google\AdsApi\AdWords\Query\v201809\ServiceQueryBuilder  $serviceQueryBuilder): \Google\AdsApi\AdWords\Query\v201809\ServiceQueryWhereBuilder

Sets the field name to be added to the WHERE clause. Every time this function is called, it will add a new condition to the WHERE clause.

All conditions are connected using the AND operator.

Parameters

string $field

a field name to be added to the WHERE clause

\Google\AdsApi\AdWords\Query\v201809\ServiceQueryBuilder $serviceQueryBuilder

the query builder object for building other parts of the AWQL string

Returns

\Google\AdsApi\AdWords\Query\v201809\ServiceQueryWhereBuilder

a builder object for setting a logic operation and argument in the WHERE clause

orderByAsc()

orderByAsc(string  $field)

Adds a field name with the ascending direction (ASC) to the ORDER BY clause.

Parameters

string $field

a field name to be added to the ORDER BY clause

orderByDesc()

orderByDesc(string  $field)

Adds a field name with the descending direction (DESC) to the ORDER BY clause.

Parameters

string $field

a field name to be added to the ORDER BY clause

limit()

limit(integer  $startIndex,integer  $pageSize)

Sets the start index and page size for the LIMIT clause.

Parameters

integer $startIndex

the start index of the first page

integer $pageSize

the count of entries to be fetched in each page

build()

build(): \Google\AdsApi\AdWords\Query\v201809\ServiceQuery

Builds a new `ServiceQuery` object.

Throws

\RuntimeException

if the select() function was not called prior to this function

Returns

\Google\AdsApi\AdWords\Query\v201809\ServiceQuery

a new ServiceQuery object

orderBy()

orderBy(string  $field,string  $descOrAsc)

Adds a field name with an ordering direction (DESC or ASC) to the ORDER BY clause.

Parameters

string $field

a field name to be added to the ORDER BY clause

string $descOrAsc

an ordering direction, either DESC or ASC

buildSelectClause()

buildSelectClause(): string

Builds the SELECT clause of the AWQL string.

Returns

string —

the SELECT clause

appendWhereClause()

appendWhereClause(string  $awql): string

Appends the WHERE clause to a partial AWQL string if the `where()` function was called prior to this function; Otherwise, this function is a no-op.

Parameters

string $awql

a partial AWQL string to append the WHERE clause

Returns

string —

the AWQL string with the WHERE clause if the where() function was called prior to this function; Otherwise, returns the AWQL without modifications

appendOrderByClause()

appendOrderByClause(string  $awqlString): string

Appends the ORDER BY clause to a partial AWQL string.

Parameters

string $awqlString

a partial AWQL string to append an ORDER BY clause

Returns

string —

the complete AWQL string with the ORDER BY clause