\Google\AdsApi\AdWords\Query\v201809ServiceQuery

A service query that embodies an AWQL string for making SOAP requests.

Summary

Methods
Properties
Constants
__construct()
__toString()
nextPage()
hasNext()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
validate()
countLandscapePoints()
$awqlString
$startIndex
$pageSize
$totalNumEntries
N/A

Properties

$awqlString

$awqlString :string

Type

string—a partial AWQL string without the LIMIT clause

$startIndex

$startIndex :

Type

$pageSize

$pageSize :

Type

$totalNumEntries

$totalNumEntries :

Type

Methods

__construct()

__construct(string  $awqlString,integer|null  $startIndex = null,integer|null  $pageSize = null)

Creates a service query object from an AWQL string without the LIMIT clause.

Do not use this constructor, instances should be created by using the ServiceQueryBuilder instead.

Parameters

string $awqlString

the AWQL string without the LIMIT clause

integer|null $startIndex

optional, the start index of the first page

integer|null $pageSize

optional, the count of entries to be fetched in each page

__toString()

__toString(): string

Returns

string —

the complete AWQL string with the LIMIT clause

nextPage()

nextPage(\Google\AdsApi\AdWords\v201809\cm\Page|null  $previousPage = null): \Google\AdsApi\AdWords\Query\v201809\ServiceQuery

Increases the start index by the current page size.

When querying against the `DataService`, an instance of `AdGroupBidLandscapePage` or `AdGroupBidLandscapePage` is required for this function to compute the current page size. These special page classes have their own paging mechanism which is different from other services. For details, see https://developers.google.com/adwords/api/docs/guides/bid-landscapes#paging_through_results

Parameters

\Google\AdsApi\AdWords\v201809\cm\Page|null $previousPage

optional, the previously fetched page which must be an instance of either AdGroupBidLandscapePage or AdGroupBidLandscapePage

Returns

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

the current ServiceQuery instance for chaining

hasNext()

hasNext(\Google\AdsApi\AdWords\v201809\cm\Page  $previousPage): boolean

Checks if there are still entries to be fetched on the next page.

When querying against the `DataService`, an instance of `AdGroupBidLandscapePage` or `AdGroupBidLandscapePage` could be returned. These special page classes have their own paging mechanism which is different from other services. For details, see https://developers.google.com/adwords/api/docs/guides/bid-landscapes#paging_through_results

Parameters

\Google\AdsApi\AdWords\v201809\cm\Page $previousPage

the previously fetched page

Returns

boolean —

true if there are still entries to be fetched on next page; Otherwise, returns false

validate()

validate(string  $awqlString,integer  $startIndex,integer  $pageSize)

Validates the arguments for constructing a service query object.

Parameters

string $awqlString

the AWQL string without the LIMIT clause

integer $startIndex

the start index of the first page

integer $pageSize

the count of entries to be fetched in each page

Throws

\InvalidArgumentException

when the AWQL string is null or empty, or contains a LIMIT clause

\OutOfBoundsException

when the start index is a negative number, or when the page size is 0 or a negative number

countLandscapePoints()

countLandscapePoints(\Google\AdsApi\AdWords\v201809\cm\Page  $page): integer

Counts the number of landscape points in a `AdGroupBidLandscapePage` or `AdGroupBidLandscapePage` page.

Parameters

\Google\AdsApi\AdWords\v201809\cm\Page $page

the previously fetched page which must be an instance of either AdGroupBidLandscapePage or AdGroupBidLandscapePage

Returns

integer —

the count of landscape points in a given page