examples/AdWords/v201809/Reporting/ParallelReportDownload.php
private static function getAllManagedCustomerIds(
        AdWordsServices $adWordsServices,
        AdWordsSession $session
    ) {
        $managedCustomerService = $adWordsServices->get($session, ManagedCustomerService::class);

        $selector = new Selector();
        $selector->setFields(['CustomerId']);
        $selector->setPaging(new Paging(0, self::PAGE_LIMIT));
        $selector->setPredicates(
            [
                new Predicate(
                    'CanManageClients',
                    PredicateOperator::EQUALS,
                    ['false']
                )
            ]
        );

        $customerIds = [];
        $totalNumEntries = 0;
        do {
            $page = $managedCustomerService->get($selector);
            if ($page->getEntries() !== null) {
                $totalNumEntries = $page->getTotalNumEntries();
                foreach ($page->getEntries() as $customer) {
                    $customerIds[] = $customer->getCustomerId();
                }
            }
            $selector->getPaging()->setStartIndex(
                $selector->getPaging()->getStartIndex() + self::PAGE_LIMIT
            );
        } while ($selector->getPaging()->getStartIndex() < $totalNumEntries);

        return $customerIds;
    }
private static function getAllManagedCustomerIds(
        AdWordsServices $adWordsServices,
        AdWordsSession $session
    ) {
        $managedCustomerService = $adWordsServices->get($session, ManagedCustomerService::class);

        $selector = new Selector();
        $selector->setFields(['CustomerId']);
        $selector->setPaging(new Paging(0, self::PAGE_LIMIT));
        $selector->setPredicates(
            [
                new Predicate(
                    'CanManageClients',
                    PredicateOperator::EQUALS,
                    ['false']
                )
            ]
        );

        $customerIds = [];
        $totalNumEntries = 0;
        do {
            $page = $managedCustomerService->get($selector);
            if ($page->getEntries() !== null) {
                $totalNumEntries = $page->getTotalNumEntries();
                foreach ($page->getEntries() as $customer) {
                    $customerIds[] = $customer->getCustomerId();
                }
            }
            $selector->getPaging()->setStartIndex(
                $selector->getPaging()->getStartIndex() + self::PAGE_LIMIT
            );
        } while ($selector->getPaging()->getStartIndex() < $totalNumEntries);

        return $customerIds;
    }
private static function getAllManagedCustomerIds ( AdWordsServices $ adWordsServices , AdWordsSession $ session ) { $ managedCustomerService = $ adWordsServices -> get ( $ session , ManagedCustomerService :: class ) ; $ selector = new Selector ( ) ; $ selector -> setFields ( [ 'CustomerId' ] ) ; $ selector -> setPaging ( new Paging ( 0 , self :: PAGE_LIMIT ) ) ; $ selector -> setPredicates ( [ new Predicate ( 'CanManageClients' , PredicateOperator :: EQUALS , [ 'false' ] ) ] ) ; $ customerIds = [ ] ; $ totalNumEntries = 0 ; do { $ page = $ managedCustomerService -> get ( $ selector ) ; if ( $ page -> getEntries ( ) !== null ) { $ totalNumEntries = $ page -> getTotalNumEntries ( ) ; foreach ( $ page -> getEntries ( ) as $ customer ) { $ customerIds [ ] = $ customer -> getCustomerId ( ) ; } } $ selector -> getPaging ( ) -> setStartIndex ( $ selector -> getPaging ( ) -> getStartIndex ( ) + self :: PAGE_LIMIT ) ; } while ( $ selector -> getPaging ( ) -> getStartIndex ( ) < $ totalNumEntries ) ; return $ customerIds ; }
Retrieves all the customer IDs under a manager account.

To set clientCustomerId to any manager account you want to get
reports for its client accounts, use `AdWordsSessionBuilder` to
create new session.
Retrieves all the customer IDs under a manager account .