\Google\AdsApi\AdManager\Util\v202108Pql

Static utility methods for working with PQL.

Summary

Methods
Properties
Constants
createValue()
toString()
getColumnLabels()
getRowStringValues()
combineResultSets()
resultSetTo2DimensionStringArray()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__construct()
No private properties found
N/A

Methods

createValue()

createValue(mixed  $value): \Google\AdsApi\AdManager\v202108\Value

Creates a PQL `Value` from the specified value.

For example:

  • A TextValue for a value of type string.
  • A BooleanValue for type bool.
  • A NumberValue for type float or int.
  • A DateTimeValue for type Ad Manager DateTime
  • A DateValue for type Ad Manager Date
  • A SetValue for type array.

If the specified value is already a PQL Value, the value is returned.

Parameters

mixed $value

the value to convert to a PQL value

Throws

\InvalidArgumentException

if value cannot be converted

Returns

\Google\AdsApi\AdManager\v202108\Value —

a PQL value of the appropriate type

toString()

toString(\Google\AdsApi\AdManager\v202108\Value  $value): string

Creates a string from the Value.

Parameters

\Google\AdsApi\AdManager\v202108\Value $value

the value to convert

Throws

\InvalidArgumentException

if value cannot be converted

Returns

string —

the string representation of the value

getColumnLabels()

getColumnLabels(\Google\AdsApi\AdManager\v202108\ResultSet  $resultSet): array<mixed,string>

Gets the column labels for the result set.

Parameters

\Google\AdsApi\AdManager\v202108\ResultSet $resultSet

the result set to get the column labels for

Returns

array<mixed,string> —

the string list of column labels

getRowStringValues()

getRowStringValues(\Google\AdsApi\AdManager\v202108\Row  $row): array<mixed,string>

Gets the values in a row of the result set in the form of a string list.

Parameters

\Google\AdsApi\AdManager\v202108\Row $row

the row to get the values for

Returns

array<mixed,string> —

the string list of row labels

combineResultSets()

combineResultSets(\Google\AdsApi\AdManager\v202108\ResultSet  $first,\Google\AdsApi\AdManager\v202108\ResultSet  $second): \Google\AdsApi\AdManager\v202108\ResultSet

Combines the first and second result sets, if and only if, the columns of both result sets match.

Parameters

\Google\AdsApi\AdManager\v202108\ResultSet $first

the first result set

\Google\AdsApi\AdManager\v202108\ResultSet $second

the second result set

Throws

\InvalidArgumentException

if the result sets to combine do not have identical column headers

Returns

\Google\AdsApi\AdManager\v202108\ResultSet —

the combined result set

resultSetTo2DimensionStringArray()

resultSetTo2DimensionStringArray(\Google\AdsApi\AdManager\v202108\ResultSet  $resultSet): array<mixed,string[]>

Gets the result set as a two dimension string array, which can be transformed to a CSV using {@see CsvFiles} such as <pre> <code> $combinedResultSet = Pql::combineResultSet($resultSet1, $resultSet2); //.

.. $combinedResultSet = Pql::combineResultSet( $combinedResultSet, $resultSet3); CsvFiles::writeCsv( Pql::resultSetTo2DimensionStringArray($combinedResultSet), $filePath);

Parameters

\Google\AdsApi\AdManager\v202108\ResultSet $resultSet

the result set to convert to a CSV compatible format

Returns

array<mixed,string[]> —

a 2 dimension array of strings representing the result set

__construct()

__construct()