本文整理匯總了PHP中StatementBuilder::WithBindVariableValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP StatementBuilder::WithBindVariableValue方法的具體用法?PHP StatementBuilder::WithBindVariableValue怎麽用?PHP StatementBuilder::WithBindVariableValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類StatementBuilder
的用法示例。
在下文中一共展示了StatementBuilder::WithBindVariableValue方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DfpUser
// relative to the DfpUser.php file's directory.
$user = new DfpUser();
// Log SOAP XML request and response.
$user->LogDefaults();
// Get the CustomTargetingService.
$customTargetingService = $user->GetService('CustomTargetingService', 'v201508');
// Get all predefined custom targeting keys.
$customTargetingKeyIds = getPredefinedCustomTargetingKeyIds($user);
// Create a statement to get all custom targeting values for a custom
// targeting key.
$statementBuilder = new StatementBuilder();
$statementBuilder->Where('customTargetingKeyId = :customTargetingKeyId')->OrderBy('id ASC')->Limit(StatementBuilder::SUGGESTED_PAGE_LIMIT);
$totalResultsCounter = 0;
foreach ($customTargetingKeyIds as $customTargetingKeyId) {
// Set the custom targeting key ID to select from.
$statementBuilder->WithBindVariableValue('customTargetingKeyId', $customTargetingKeyId);
// Default for total result set size and offset.
$totalResultSetSize = 0;
$statementBuilder->Offset(0);
do {
// Get custom targeting values by statement.
$page = $customTargetingService->getCustomTargetingValuesByStatement($statementBuilder->ToStatement());
// Display results.
if (isset($page->results)) {
$totalResultSetSize = $page->totalResultSetSize;
foreach ($page->results as $customTargetingValue) {
printf("%d) Custom targeting value with ID %d, belonging to key with " . "ID %d, name '%s', and display name '%s' was found.\n", $totalResultsCounter++, $customTargetingValue->id, $customTargetingValue->customTargetingKeyId, $customTargetingValue->name, $customTargetingValue->displayName);
}
}
$statementBuilder->IncreaseOffsetBy(StatementBuilder::SUGGESTED_PAGE_LIMIT);
} while ($statementBuilder->GetOffset() < $totalResultSetSize);
開發者ID:stevenmaguire,項目名稱:googleads-php-lib,代碼行數:31,代碼來源:GetPredefinedCustomTargetingKeysAndValues.php
示例2: testWithBindingVariable
/**
* @covers StatementBuilder::WithBindVariableValue
*/
public function testWithBindingVariable()
{
$key = 'key';
$value = 'value';
$statementBuilder = new StatementBuilder();
$statementBuilder->WithBindVariableValue($key, $value);
$bindVariableMap = $statementBuilder->GetBindVariableMap();
$this->assertEquals($value, $bindVariableMap[$key]->value);
}