public function tearDown()
 {
     if ($this->productCatalog) {
         $this->productCatalog->delete();
         $this->productCatalog = null;
     }
     parent::tearDown();
 }
 public function tearDown()
 {
     if ($this->productSet) {
         $this->productSet->delete();
         $this->productSet = null;
     }
     if ($this->productCatalog) {
         $this->productCatalog->delete();
         $this->productCatalog = null;
     }
     if ($this->productAudience) {
         $this->productAudience->delete();
         $this->productAudience = null;
     }
     if ($this->adCampaign) {
         $this->adCampaign->delete();
         $this->adCampaign = null;
     }
     if ($this->adSet) {
         $this->adSet->delete();
         $this->adSet = null;
     }
     if ($this->adGroup) {
         $this->adGroup->delete();
         $this->adGroup = null;
     }
     if ($this->creative) {
         $this->creative->delete();
         $this->creative = null;
     }
     parent::tearDown();
 }
$campaign = new AdCampaign(null, $ad_account_id);
$campaign->setData(array(AdCampaignFields::NAME => 'Video Views Campaign', AdCampaignFields::OBJECTIVE => AdObjectives::VIDEO_VIEWS, AdCampaignFields::STATUS => AdCampaign::STATUS_PAUSED));
$campaign->create();
// _DOC close [ADCAMPAIGN_CREATE_VIDEO_VIEWS]
$campaign->delete();
// _DOC open [ADCAMPAIGN_CREATE_LOCAL_AWARENESS]
// _DOC vars [ad_account_id:s]
// use FacebookAds\Object\AdCampaign;
// use FacebookAds\Object\AdCampaignFields;
// use FacebookAds\Object\Values\AdObjectives;
$campaign = new AdCampaign(null, $ad_account_id);
$campaign->setData(array(AdCampaignFields::NAME => 'Local awareness campaign', AdCampaignFields::OBJECTIVE => AdObjectives::LOCAL_AWARENESS, AdCampaignFields::STATUS => AdCampaign::STATUS_PAUSED));
$campaign->create();
// _DOC close [ADCAMPAIGN_CREATE_LOCAL_AWARENESS]
$campaign->delete();
$product_catalog = new ProductCatalog(null, $business_id);
$product_catalog->setData(array(ProductCatalogFields::NAME => 'Test Catalog'));
$product_catalog->create();
$product_catalog_id = $product_catalog->{ProductCatalogFields::ID};
// _DOC open [ADCAMPAIGN_CREATE_OBJECTIVE_PRODUCT_CATELOG_SALES]
// _DOC vars [ad_account_id:s, product_catalog_id]
// use FacebookAds\Object\AdCampaign;
// use FacebookAds\Object\Fields\AdCampaignFields;
// use FacebookAds\Object\Values\AdObjectives;
$campaign = new AdCampaign(null, $ad_account_id);
$campaign->setData(array(AdCampaignFields::NAME => 'Product Catalog Sales Campaign Group', AdCampaignFields::OBJECTIVE => AdObjectives::PRODUCT_CATALOG_SALES, AdCampaignFields::STATUS => AdCampaign::STATUS_PAUSED, AdCampaignFields::PROMOTED_OBJECT => array('product_catalog_id' => $product_catalog_id)));
$campaign->create();
// _DOC close [ADCAMPAIGN_CREATE_OBJECTIVE_PRODUCT_CATELOG_SALES]
$campaign->delete();
$product_catalog->delete();