examples/AdWords/v201809/Migration/MigrateToExtensionSettings.php
private static function getFeedItemIdsForCampaignFeed($campaignFeed)
    {
        $feedItemIds = [];

        if ($campaignFeed->getMatchingFunction()->getOperator() === FunctionOperator::IN) {
            // Check if matchingFunction is of the form IN(FEED_ITEM_ID,{xxx,xxx}).
            // Extract feed items if applicable.
            $feedItemIds = array_merge(
                $feedItemIds,
                self::getFeedItemIdsFromArgument($campaignFeed->getMatchingFunction())
            );
        } elseif ($campaignFeed->getMatchingFunction()->getOperator() === FunctionOperator::AND_VALUE) {
            foreach ($campaignFeed->getMatchingFunction()->getLhsOperand() as $argument) {
                // Check if matchingFunction is of the form IN(FEED_ITEM_ID,{xxx,xxx}).
                // Extract feed items if applicable.
                if ($argument instanceof FunctionOperand) {
                    if ($argument->getValue()->getOperator() === FunctionOperator::IN) {
                        $feedItemIds = array_merge(
                            $feedItemIds,
                            self::getFeedItemIdsFromArgument($argument->getValue())
                        );
                    }
                }
            }
        }

        return $feedItemIds;
    }
private static function getFeedItemIdsForCampaignFeed($campaignFeed)
    {
        $feedItemIds = [];

        if ($campaignFeed->getMatchingFunction()->getOperator() === FunctionOperator::IN) {
            // Check if matchingFunction is of the form IN(FEED_ITEM_ID,{xxx,xxx}).
            // Extract feed items if applicable.
            $feedItemIds = array_merge(
                $feedItemIds,
                self::getFeedItemIdsFromArgument($campaignFeed->getMatchingFunction())
            );
        } elseif ($campaignFeed->getMatchingFunction()->getOperator() === FunctionOperator::AND_VALUE) {
            foreach ($campaignFeed->getMatchingFunction()->getLhsOperand() as $argument) {
                // Check if matchingFunction is of the form IN(FEED_ITEM_ID,{xxx,xxx}).
                // Extract feed items if applicable.
                if ($argument instanceof FunctionOperand) {
                    if ($argument->getValue()->getOperator() === FunctionOperator::IN) {
                        $feedItemIds = array_merge(
                            $feedItemIds,
                            self::getFeedItemIdsFromArgument($argument->getValue())
                        );
                    }
                }
            }
        }

        return $feedItemIds;
    }
private static function getFeedItemIdsForCampaignFeed ( $ campaignFeed ) { $ feedItemIds = [ ] ; if ( $ campaignFeed -> getMatchingFunction ( ) -> getOperator ( ) === FunctionOperator :: IN ) { // Check if matchingFunction is of the form IN(FEED_ITEM_ID,{xxx,xxx}). // Extract feed items if applicable. $ feedItemIds = array_merge ( $ feedItemIds , self :: getFeedItemIdsFromArgument ( $ campaignFeed -> getMatchingFunction ( ) ) ) ; } elseif ( $ campaignFeed -> getMatchingFunction ( ) -> getOperator ( ) === FunctionOperator :: AND_VALUE ) { foreach ( $ campaignFeed -> getMatchingFunction ( ) -> getLhsOperand ( ) as $ argument ) { // Check if matchingFunction is of the form IN(FEED_ITEM_ID,{xxx,xxx}). // Extract feed items if applicable. if ( $ argument instanceof FunctionOperand ) { if ( $ argument -> getValue ( ) -> getOperator ( ) === FunctionOperator :: IN ) { $ feedItemIds = array_merge ( $ feedItemIds , self :: getFeedItemIdsFromArgument ( $ argument -> getValue ( ) ) ) ; } } } } return $ feedItemIds ; }
Gets feed item IDs from the specified campaign feed.
Gets feed item IDs from the specified campaign feed .