if (isset($page->entries)) {
            foreach ($page->entries as $adGroupAd) {
                printf("Ad with ID '%.0f', and type '%s' was disapproved for the " . "following reasons:\n", $adGroupAd->ad->id, $adGroupAd->ad->AdType);
                if (!empty($adGroupAd->disapprovalReasons)) {
                    foreach ($adGroupAd->disapprovalReasons as $reason) {
                        printf("\t'%s'\n", $reason);
                    }
                }
            }
        } else {
            print "No disapproved ads were found.\n";
        }
        // Advance the paging offset.
        $offset += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
    } while ($page->totalNumEntries > $offset);
}
// Don't run the example if the file is being included.
if (__FILE__ != realpath($_SERVER['PHP_SELF'])) {
    return;
}
try {
    // Get AdWordsUser from credentials in "../auth.ini"
    // relative to the AdWordsUser.php file's directory.
    $user = new AdWordsUser();
    // Log every SOAP XML request and response.
    $user->LogAll();
    // Run the example.
    GetAllDisapprovedAdsWithAwqlExample($user, $adGroupId);
} catch (Exception $e) {
    printf("An error has occurred: %s\n", $e->getMessage());
}
 public function testGetAllDisapprovedAdsWithAwqlExample()
 {
     GetAllDisapprovedAdsWithAwqlExample($this->user, $this->adGroupId);
 }