src/Google/AdsApi/AdWords/Shopping/v201809/ProductPartitions.php
public static function asBiddableAdGroupCriterion(
        $adGroupId,
        ProductPartition $productPartition,
        $bidAmount = null
    ) {
        $criterion = new BiddableAdGroupCriterion();

        if ($bidAmount !== null && $bidAmount > 0) {
            $biddingStrategyConfiguration = new BiddingStrategyConfiguration();
            $cpcBid = new CpcBid();
            $money = new Money();
            $money->setMicroAmount($bidAmount);
            $cpcBid->setBid($money);
            $biddingStrategyConfiguration->setBids([$cpcBid]);

            $criterion->setBiddingStrategyConfiguration(
                $biddingStrategyConfiguration
            );
        }
        $criterion->setAdGroupId($adGroupId);
        $criterion->setCriterion($productPartition);

        return $criterion;
    }
public static function asBiddableAdGroupCriterion(
        $adGroupId,
        ProductPartition $productPartition,
        $bidAmount = null
    ) {
        $criterion = new BiddableAdGroupCriterion();

        if ($bidAmount !== null && $bidAmount > 0) {
            $biddingStrategyConfiguration = new BiddingStrategyConfiguration();
            $cpcBid = new CpcBid();
            $money = new Money();
            $money->setMicroAmount($bidAmount);
            $cpcBid->setBid($money);
            $biddingStrategyConfiguration->setBids([$cpcBid]);

            $criterion->setBiddingStrategyConfiguration(
                $biddingStrategyConfiguration
            );
        }
        $criterion->setAdGroupId($adGroupId);
        $criterion->setCriterion($productPartition);

        return $criterion;
    }
public static function asBiddableAdGroupCriterion ( $ adGroupId , ProductPartition $ productPartition , $ bidAmount = null ) { $ criterion = new BiddableAdGroupCriterion ( ) ; if ( $ bidAmount !== null && $ bidAmount > 0 ) { $ biddingStrategyConfiguration = new BiddingStrategyConfiguration ( ) ; $ cpcBid = new CpcBid ( ) ; $ money = new Money ( ) ; $ money -> setMicroAmount ( $ bidAmount ) ; $ cpcBid -> setBid ( $ money ) ; $ biddingStrategyConfiguration -> setBids ( [ $ cpcBid ] ) ; $ criterion -> setBiddingStrategyConfiguration ( $ biddingStrategyConfiguration ) ; } $ criterion -> setAdGroupId ( $ adGroupId ) ; $ criterion -> setCriterion ( $ productPartition ) ; return $ criterion ; }
Returns the biddable ad group criterion with by specifying the product
partition and bid amount.

@param int $adGroupId the ID of ad group that this ad group criterion is
created under
@param ProductPartition $productPartition the product partition to create
an ad group criterion
@param null|$bidAmount the bid for the product partition in micro amount
@return BiddableAdGroupCriterion the created biddable ad group criterion
Returns the biddable ad group criterion with by specifying the product partition and bid amount .