examples/AdWords/v201809/AdvancedOperations/AddDynamicSearchAdsCampaign.php
private static function createBudget(
        AdWordsServices $adWordsServices,
        AdWordsSession $session
    ) {
        $budgetService = $adWordsServices->get($session, BudgetService::class);

        // Create a budget, which can be shared by multiple campaigns.
        $sharedBudget = new Budget();
        $sharedBudget->setName('Interplanetary Cruise #' . uniqid());
        $money = new Money();
        $money->setMicroAmount(50000000);
        $sharedBudget->setAmount($money);
        $sharedBudget->setDeliveryMethod(BudgetBudgetDeliveryMethod::STANDARD);

        // Create a budget operation.
        $operation = new BudgetOperation();
        $operation->setOperand($sharedBudget);
        $operation->setOperator(Operator::ADD);

        // Create the budget on the server.
        $result = $budgetService->mutate([$operation]);
        $sharedBudget = $result->getValue()[0];

        return $sharedBudget;
    }
private static function createBudget(
        AdWordsServices $adWordsServices,
        AdWordsSession $session
    ) {
        $budgetService = $adWordsServices->get($session, BudgetService::class);

        // Create a budget, which can be shared by multiple campaigns.
        $sharedBudget = new Budget();
        $sharedBudget->setName('Interplanetary Cruise #' . uniqid());
        $money = new Money();
        $money->setMicroAmount(50000000);
        $sharedBudget->setAmount($money);
        $sharedBudget->setDeliveryMethod(BudgetBudgetDeliveryMethod::STANDARD);

        // Create a budget operation.
        $operation = new BudgetOperation();
        $operation->setOperand($sharedBudget);
        $operation->setOperator(Operator::ADD);

        // Create the budget on the server.
        $result = $budgetService->mutate([$operation]);
        $sharedBudget = $result->getValue()[0];

        return $sharedBudget;
    }
private static function createBudget ( AdWordsServices $ adWordsServices , AdWordsSession $ session ) { $ budgetService = $ adWordsServices -> get ( $ session , BudgetService :: class ) ; // Create a budget, which can be shared by multiple campaigns. $ sharedBudget = new Budget ( ) ; $ sharedBudget -> setName ( 'Interplanetary Cruise #' . uniqid ( ) ) ; $ money = new Money ( ) ; $ money -> setMicroAmount ( 50000000 ) ; $ sharedBudget -> setAmount ( $ money ) ; $ sharedBudget -> setDeliveryMethod ( BudgetBudgetDeliveryMethod :: STANDARD ) ; // Create a budget operation. $ operation = new BudgetOperation ( ) ; $ operation -> setOperand ( $ sharedBudget ) ; $ operation -> setOperator ( Operator :: ADD ) ; // Create the budget on the server. $ result = $ budgetService -> mutate ( [ $ operation ] ) ; $ sharedBudget = $ result -> getValue ( ) [ 0 ] ; return $ sharedBudget ; }
Creates the budget.
Creates the budget .