examples/AdWords/v201809/Migration/MigrateToExtensionSettings.php
private static function getFeedItems(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        $feedId
    ) {
        $feedItemService =
            $adWordsServices->get($session, FeedItemService::class);

        // Create paging controls.
        $totalNumEntries = 0;
        $offset = 0;
        $query = sprintf(
            'SELECT FeedItemId, AttributeValues WHERE Status = '
            . '"ENABLED" AND FeedId = %d',
            $feedId
        );
        $feedItems = [];
        do {
            $pageQuery =
                sprintf('%s LIMIT %d,%d', $query, $offset, self::PAGE_LIMIT);

            // Make the query request.
            $page = $feedItemService->query($pageQuery);

            if ($page->getEntries() !== null) {
                $totalNumEntries = $page->getTotalNumEntries();
                foreach ($page->getEntries() as $feedItem) {
                    $feedItems[] = $feedItem;
                }
            }
            // Advance the paging offset.
            $offset += self::PAGE_LIMIT;
        } while ($offset < $totalNumEntries);

        return $feedItems;
    }
private static function getFeedItems(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        $feedId
    ) {
        $feedItemService =
            $adWordsServices->get($session, FeedItemService::class);

        // Create paging controls.
        $totalNumEntries = 0;
        $offset = 0;
        $query = sprintf(
            'SELECT FeedItemId, AttributeValues WHERE Status = '
            . '"ENABLED" AND FeedId = %d',
            $feedId
        );
        $feedItems = [];
        do {
            $pageQuery =
                sprintf('%s LIMIT %d,%d', $query, $offset, self::PAGE_LIMIT);

            // Make the query request.
            $page = $feedItemService->query($pageQuery);

            if ($page->getEntries() !== null) {
                $totalNumEntries = $page->getTotalNumEntries();
                foreach ($page->getEntries() as $feedItem) {
                    $feedItems[] = $feedItem;
                }
            }
            // Advance the paging offset.
            $offset += self::PAGE_LIMIT;
        } while ($offset < $totalNumEntries);

        return $feedItems;
    }
private static function getFeedItems ( AdWordsServices $ adWordsServices , AdWordsSession $ session , $ feedId ) { $ feedItemService = $ adWordsServices -> get ( $ session , FeedItemService :: class ) ; // Create paging controls. $ totalNumEntries = 0 ; $ offset = 0 ; $ query = sprintf ( 'SELECT FeedItemId, AttributeValues WHERE Status = ' . '"ENABLED" AND FeedId = %d' , $ feedId ) ; $ feedItems = [ ] ; do { $ pageQuery = sprintf ( '%s LIMIT %d,%d' , $ query , $ offset , self :: PAGE_LIMIT ) ; // Make the query request. $ page = $ feedItemService -> query ( $ pageQuery ) ; if ( $ page -> getEntries ( ) !== null ) { $ totalNumEntries = $ page -> getTotalNumEntries ( ) ; foreach ( $ page -> getEntries ( ) as $ feedItem ) { $ feedItems [ ] = $ feedItem ; } } // Advance the paging offset. $ offset += self :: PAGE_LIMIT ; } while ( $ offset < $ totalNumEntries ) ; return $ feedItems ; }
Gets all enabled feed items of the specified feed.
Gets all enabled feed items of the specified feed .