當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DfpUser::LogAll方法代碼示例

本文整理匯總了PHP中DfpUser::LogAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP DfpUser::LogAll方法的具體用法?PHP DfpUser::LogAll怎麽用?PHP DfpUser::LogAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DfpUser的用法示例。


在下文中一共展示了DfpUser::LogAll方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

{
    // A map of deprecated geo targets to the line items targeting them.
    $lineItemsToUpdate = array();
    foreach ($geoTargetToLineItemsMap as $geoTargetId => $lineItemIds) {
        if (in_array($geoTargetId, $untargetableLocationIds)) {
            $lineItemsToUpdate[$geoTargetId] = $lineItemIds;
        }
    }
    return $lineItemsToUpdate;
}
try {
    // Get DfpUser from credentials in "../auth.ini"
    // relative to the DfpUser.php file's directory.
    $user = new DfpUser();
    // Log SOAP XML request and response.
    $user->LogAll();
    // Find all untargetable locations.
    $untargetableLocationIds = getAllUntargetableLocations($user);
    printf("Found %d untargetable locations.\n", count($untargetableLocationIds));
    // Build a map of geo targets to the line items targeting them.
    $geoTargetToLineItemsMap = buildGeoTargetToLineItemsMap($user);
    // Find all the deprecated geo targets from that map.
    $lineItemsToUpdate = findLineItemsToUpdate($geoTargetToLineItemsMap, $untargetableLocationIds);
    $i = 0;
    // Print the line items that need to be updated.
    foreach ($lineItemsToUpdate as $geoTargetId => $lineItemIds) {
        printf("%d) The following line items are targeting deprecated location %d" . " and need to be updated: %s\n", $i, $geoTargetId, implode(', ', $lineItemIds));
        $i++;
    }
} catch (OAuth2Exception $e) {
    ExampleUtils::CheckForOAuth2Errors($e);
開發者ID:planetfitnessnational,項目名稱:googleads-php-lib,代碼行數:31,代碼來源:AuditLineItemsGeoTargetingExample.php


注:本文中的DfpUser::LogAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。