SUGGESTED_PAGE_LIMIT
SUGGESTED_PAGE_LIMIT
Builds statements that can be used in PQL queries.
Typical usage:
$statementBuilder = (new StatementBuilder())
->where('lastModifiedDateTime > :yesterday AND status = :status')
->orderBy('id ASC')
->limit(200)
->withBindVariableValue(
'yesterday',
AdManagerDateTimes::fromDateTime(new DateTime(
'-1 day',
new DateTimeZone('America/New_York')
)))
->withBindVariableValue('status', SomeStatus::STATUS);
$statement = $statementBuilder->toStatement();
//...
$statementBuilder->increaseOffsetBy(200);
$statement = $statementBuilder->toStatement();
withBindVariableValue(string $key,mixed $value): \Google\AdsApi\AdManager\Util\v202202\StatementBuilder
Adds a bind variable value to the statement.
string | $key | the value key |
mixed | $value | the value either as a primitive, which will be
converted to a PQL |
this builder
select(string $columns): \Google\AdsApi\AdManager\Util\v202202\StatementBuilder
Sets the statement `SELECT` clause in the form of 'a, b, .
..'.
Only necessary for statements being sent to the
PublisherQueryLanguageService
. The 'SELECT ' keyword will be ignored.
string | $columns | the statement select clause without |
this builder
from(string $table): \Google\AdsApi\AdManager\Util\v202202\StatementBuilder
Sets the statement `FROM` clause in the form of 'table'.
Only necessary for statements being sent to the
PublisherQueryLanguageService
. The 'FROM ' keyword will be ignored.
string | $table | the statement from clause without |
this builder
where(string $conditions): \Google\AdsApi\AdManager\Util\v202202\StatementBuilder
Sets the statement `WHERE` clause in the form of `'WHERE <condition> {[AND | OR] <condition> .
..}'`. E.g., 'a = b OR b = c'. The 'WHERE ' keyword will be ignored.
string | $conditions | the statement query without |
this builder
limit(integer $count): \Google\AdsApi\AdManager\Util\v202202\StatementBuilder
Sets the statement `LIMIT` clause in the form of `'LIMIT <count>'`. E.g., 1000.
integer | $count | the statement limit |
this builder
offset(integer $count): \Google\AdsApi\AdManager\Util\v202202\StatementBuilder
Sets the statement `OFFSET` clause in the form of `'OFFSET <count>'`. E.g., 200.
integer | $count | the statement offset |
this builder
increaseOffsetBy(integer $amount): \Google\AdsApi\AdManager\Util\v202202\StatementBuilder
Increases the offset by the specified amount.
integer | $amount |
this builder
removeLimitAndOffset(): \Google\AdsApi\AdManager\Util\v202202\StatementBuilder
Removes the limit and offset from the query.
this builder
orderBy(string $orderBy): \Google\AdsApi\AdManager\Util\v202202\StatementBuilder
Sets the statement `ORDER BY` clause in the form of `'ORDER BY <property> [ASC | DESC]'`. E.g., 'type ASC, lastModifiedDateTime DESC'. The 'ORDER BY' keyword will be ignored.
string | $orderBy | the statement order by without |
this builder