examples/AdWords/v201809/AdvancedOperations/AddAdCustomizer.php
private static function createCustomizerFeed(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        $feedName
    ) {
        $adCustomizerFeedService = $adWordsServices->get($session, AdCustomizerFeedService::class);
        $nameAttribute = new AdCustomizerFeedAttribute();
        $nameAttribute->setName('Name');
        $nameAttribute->setType(AdCustomizerFeedAttributeType::STRING);

        $priceAttribute = new AdCustomizerFeedAttribute();
        $priceAttribute->setName('Price');
        $priceAttribute->setType(AdCustomizerFeedAttributeType::STRING);

        $dateAttribute = new AdCustomizerFeedAttribute();
        $dateAttribute->setName('Date');
        $dateAttribute->setType(AdCustomizerFeedAttributeType::DATE_TIME);

        $customizerFeed = new AdCustomizerFeed();
        $customizerFeed->setFeedName($feedName);
        $customizerFeed->setFeedAttributes(
            [$nameAttribute, $priceAttribute, $dateAttribute]
        );

        $feedOperation = new AdCustomizerFeedOperation();
        $feedOperation->setOperand($customizerFeed);
        $feedOperation->setOperator(Operator::ADD);
        $operations = [$feedOperation];

        $result = $adCustomizerFeedService->mutate($operations);
        $addedFeed = $result->getValue()[0];

        printf(
            "Created ad customizer feed with ID %d, name '%s' and attributes:\n",
            $addedFeed->getFeedId(),
            $addedFeed->getFeedName()
        );
        if (empty($addedFeed)) {
            print "  No attributes\n";
        } else {
            foreach ($addedFeed->getFeedAttributes() as $feedAttribute) {
                printf(
                    "  ID: %d, name: '%s', type: %s\n",
                    $feedAttribute->getId(),
                    $feedAttribute->getName(),
                    $feedAttribute->getType()
                );
            }
        }


        return $addedFeed;
    }
private static function createCustomizerFeed(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        $feedName
    ) {
        $adCustomizerFeedService = $adWordsServices->get($session, AdCustomizerFeedService::class);
        $nameAttribute = new AdCustomizerFeedAttribute();
        $nameAttribute->setName('Name');
        $nameAttribute->setType(AdCustomizerFeedAttributeType::STRING);

        $priceAttribute = new AdCustomizerFeedAttribute();
        $priceAttribute->setName('Price');
        $priceAttribute->setType(AdCustomizerFeedAttributeType::STRING);

        $dateAttribute = new AdCustomizerFeedAttribute();
        $dateAttribute->setName('Date');
        $dateAttribute->setType(AdCustomizerFeedAttributeType::DATE_TIME);

        $customizerFeed = new AdCustomizerFeed();
        $customizerFeed->setFeedName($feedName);
        $customizerFeed->setFeedAttributes(
            [$nameAttribute, $priceAttribute, $dateAttribute]
        );

        $feedOperation = new AdCustomizerFeedOperation();
        $feedOperation->setOperand($customizerFeed);
        $feedOperation->setOperator(Operator::ADD);
        $operations = [$feedOperation];

        $result = $adCustomizerFeedService->mutate($operations);
        $addedFeed = $result->getValue()[0];

        printf(
            "Created ad customizer feed with ID %d, name '%s' and attributes:\n",
            $addedFeed->getFeedId(),
            $addedFeed->getFeedName()
        );
        if (empty($addedFeed)) {
            print "  No attributes\n";
        } else {
            foreach ($addedFeed->getFeedAttributes() as $feedAttribute) {
                printf(
                    "  ID: %d, name: '%s', type: %s\n",
                    $feedAttribute->getId(),
                    $feedAttribute->getName(),
                    $feedAttribute->getType()
                );
            }
        }


        return $addedFeed;
    }
private static function createCustomizerFeed ( AdWordsServices $ adWordsServices , AdWordsSession $ session , $ feedName ) { $ adCustomizerFeedService = $ adWordsServices -> get ( $ session , AdCustomizerFeedService :: class ) ; $ nameAttribute = new AdCustomizerFeedAttribute ( ) ; $ nameAttribute -> setName ( 'Name' ) ; $ nameAttribute -> setType ( AdCustomizerFeedAttributeType :: STRING ) ; $ priceAttribute = new AdCustomizerFeedAttribute ( ) ; $ priceAttribute -> setName ( 'Price' ) ; $ priceAttribute -> setType ( AdCustomizerFeedAttributeType :: STRING ) ; $ dateAttribute = new AdCustomizerFeedAttribute ( ) ; $ dateAttribute -> setName ( 'Date' ) ; $ dateAttribute -> setType ( AdCustomizerFeedAttributeType :: DATE_TIME ) ; $ customizerFeed = new AdCustomizerFeed ( ) ; $ customizerFeed -> setFeedName ( $ feedName ) ; $ customizerFeed -> setFeedAttributes ( [ $ nameAttribute , $ priceAttribute , $ dateAttribute ] ) ; $ feedOperation = new AdCustomizerFeedOperation ( ) ; $ feedOperation -> setOperand ( $ customizerFeed ) ; $ feedOperation -> setOperator ( Operator :: ADD ) ; $ operations = [ $ feedOperation ] ; $ result = $ adCustomizerFeedService -> mutate ( $ operations ) ; $ addedFeed = $ result -> getValue ( ) [ 0 ] ; printf ( "Created ad customizer feed with ID %d, name '%s' and attributes:\n" , $ addedFeed -> getFeedId ( ) , $ addedFeed -> getFeedName ( ) ) ; if ( empty ( $ addedFeed ) ) { print "  No attributes\n" ; } else { foreach ( $ addedFeed -> getFeedAttributes ( ) as $ feedAttribute ) { printf ( "  ID: %d, name: '%s', type: %s\n" , $ feedAttribute -> getId ( ) , $ feedAttribute -> getName ( ) , $ feedAttribute -> getType ( ) ) ; } } return $ addedFeed ; }
Creates a new feed for AdCustomizerFeed.

@param AdWordsServices $adWordsServices the AdWords services
@param AdWordsSession $session the AdWords session
@param string $feedName the name of feed to be created
@return AdCustomizerFeed the ad customizer feed
Creates a new feed for AdCustomizerFeed .