Properties

$fieldName

$fieldName :

Type

$simpleOperator

$simpleOperator :

Type

$simpleValue

$simpleValue :

Type

$listOperator

$listOperator :

Type

$listValues

$listValues :

Type

Methods

__construct()

__construct(string  $fieldName)

Creates an expression builder and sets the field name which is the left-hand operand of a logic expression.

Parameters

string $fieldName

the field name to be used as the left-hand operand of a logic expression

copyFrom()

copyFrom(\Google\AdsApi\AdWords\Query\v201809\ExpressionBuilder  $otherInstance): \Google\AdsApi\AdWords\Query\v201809\ExpressionBuilder

Creates a new expression builder object by copying the operands and operators from another expression builder object.

Parameters

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

the other expression builder object for copying the operands and operators

Returns

\Google\AdsApi\AdWords\Query\v201809\ExpressionBuilder

a new expression builder object that copies from the input one

equalTo()

equalTo(string  $value)

Sets the value that follows the equal (=) operator.

Parameters

string $value

represents the value for comparison

notEqualTo()

notEqualTo(string  $value)

Sets the value that follows the not equal (!=) operator.

Parameters

string $value

represents the value for comparison

greaterThan()

greaterThan(string  $value)

Sets the value that follows the greater than (>) operator.

Parameters

string $value

represents the value for comparison

greaterThanOrEqualTo()

greaterThanOrEqualTo(string  $value)

Sets the value that follows the greater than or equal (>=) operator.

Parameters

string $value

represents the value for comparison

lessThan()

lessThan(string  $value)

Sets the value that follows the less than (<) operator.

Parameters

string $value

represents the value for comparison

lessThanOrEqualTo()

lessThanOrEqualTo(string  $value)

Sets the value that follows the less than or equal (<=) operator.

Parameters

string $value

represents the value for comparison

startsWith()

startsWith(string  $value)

Sets the value that follows the STARTS_WITH operator.

Parameters

string $value

represents the value for comparison

startsWithIgnoreCase()

startsWithIgnoreCase(string  $value)

Sets the value that follows the STARTS_WITH_IGNORE_CASE operator.

Parameters

string $value

represents the value for comparison

contains()

contains(string  $value)

Sets the value that follows the CONTAINS operator.

Parameters

string $value

represents the value for comparison

containsIgnoreCase()

containsIgnoreCase(string  $value)

Sets the value that follows the CONTAINS_IGNORE_CASE operator.

Parameters

string $value

represents the value for comparison

doesNotContain()

doesNotContain(string  $value)

Sets the value that follows the DOES_NOT_CONTAIN operator.

Parameters

string $value

represents the value for comparison

doesNotContainIgnoreCase()

doesNotContainIgnoreCase(string  $value)

Sets the value that follows the DOES_NOT_CONTAIN_IGNORE_CASE operator.

Parameters

string $value

represents the value for comparison

in()

in(array  $values)

Sets the list of values that follows the IN operator.

Parameters

array $values

the list of values that follows the IN operator

notIn()

notIn(array  $values)

Sets the list of values that follows the NOT_IN operator.

Parameters

array $values

the list of values that follows the NOT_IN operator

containsAny()

containsAny(array  $values)

Sets the list of values that follows the CONTAINS_ANY operator.

Parameters

array $values

the list of values that follows the CONTAINS_ANY operator

containsNone()

containsNone(array  $values)

Sets the list of values that follows the CONTAINS_NONE operator.

Parameters

array $values

the list of values that follows the CONTAINS_NONE operator

containsAll()

containsAll(array  $values)

Sets the list of values that follows the CONTAINS_ALL operator.

Parameters

array $values

the list of values that follows the CONTAINS_ALL operator

buildExpression()

buildExpression(): string

Builds a logic expression in the WHERE clause of an AWQL string.

Throws

\BadFunctionCallException

when no operators was specified prior to calling this function

Returns

string —

a logic expression in the WHERE clause of an AWQL string

setSimpleOperator()

setSimpleOperator(string  $operator,string  $value)

Sets an operator and a single value that follows the operator.

Parameters

string $operator

the operator that works with a single value

string $value

a number or string that follows the operator

formatValue()

formatValue(mixed  $value): integer|string

If the input value is not numeric, escape all quotes, then wrap the string in a pair of quotes.

Parameters

mixed $value

a value to be formatted

Returns

integer|string —

a number if the input is a numeric value; Otherwise, returns a quoted string

formatValues()

formatValues(array  $listValues): array

Formats each individual value in an array.

Parameters

array $listValues

the array containing values to be formatted

Returns

array —

a new array containing formatted values

setListOperator()

setListOperator(string  $listOperator,array  $values)

Sets the list operator and values; Also, adds quotes to string values.

Parameters

string $listOperator

an operator that works with a list of values

array $values

the list of values that follows the operator