From 369cf3936e9df138a039169a66bc88aafa1fc596 Mon Sep 17 00:00:00 2001 From: Dulio Matos Leite Date: Tue, 12 Apr 2016 12:51:26 -0700 Subject: [PATCH] v2.6 Breaking Changes Summary: - Deprecated the `connectionobjects` API which retrieved all object types and replace it with other APIs that return specific object types - Deprecated `max_product_count` since Facebook now automatically optimizes the number of products to show for Dynamic Product ads. In order to opt-out of Carousel format, specify `force_single_link=true`. - Deprecated `product_ad_behavior` field at the Ad Set level - The `fields` parameter no longer accepts breakdowns, such as age or gender. Now you should specified this in 'breakdowns' parameter in query. This includes:- `age`, `country`, `gender`, `frequency_value`,`hourly_stats_aggregated_by_advertiser_time_zone`, `hourly_stats_aggregated_by_audience_time_zone`, `impression_device`, `place_page_id`, `placement`, `product_id`, and `region`This appplies to /insights for all object levels. Test Plan: Run all tests; Alternatively if you want to check specific breaking changes, choose the one's related to it, e.g. for f in docs/*INSIGHTS*; do ./bin/docsmith.php test $f; done for f in docs/*DPA*; do ./bin/docsmith.php test $f; done --- README.md | 4 + examples/connectionobjects.php | 112 ------------------ src/FacebookAds/Api.php | 2 +- src/FacebookAds/Object/AdAccount.php | 11 -- src/FacebookAds/Object/ConnectionObject.php | 39 ------ .../Object/Fields/ConnectionObjectFields.php | 55 --------- .../Object/Fields/InsightsFields.php | 12 -- .../Fields/ObjectStory/TemplateDataFields.php | 2 +- .../Object/Values/ConnectionObjectTypes.php | 39 ------ .../Object/Values/InsightsBreakdowns.php | 5 +- test/FacebookAdsTest/Object/AdAccountTest.php | 1 - .../Object/DynamicProductAdsAdvertTest.php | 1 - 12 files changed, 10 insertions(+), 273 deletions(-) delete mode 100644 examples/connectionobjects.php delete mode 100644 src/FacebookAds/Object/ConnectionObject.php delete mode 100644 src/FacebookAds/Object/Fields/ConnectionObjectFields.php delete mode 100644 src/FacebookAds/Object/Values/ConnectionObjectTypes.php diff --git a/README.md b/README.md index 0ce78a716..daee5d157 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Facebook Ads API SDK for PHP +**IMPORTANT**: This is the legacy SDK. This will be deprecated when API v2.7 is released +Please start migrating to the autogenerated SDK which you can find [here](https://github.com/facebook/facebook-php-ads-sdk). + + [![Packagist](https://img.shields.io/packagist/v/facebook/php-ads-sdk.svg?style=flat-square)](https://packagist.org/packages/facebook/php-ads-sdk) [![License](https://img.shields.io/badge/license-Facebook%20Platform-blue.svg?style=flat-square)](https://github.com/facebook/facebook-php-ads-sdk/blob/master/LICENSE) [![Travis](https://img.shields.io/travis/facebook/facebook-php-ads-sdk.svg?style=flat-square)](https://travis-ci.org/facebook/facebook-php-ads-sdk) diff --git a/examples/connectionobjects.php b/examples/connectionobjects.php deleted file mode 100644 index a9ec78ff6..000000000 --- a/examples/connectionobjects.php +++ /dev/null @@ -1,112 +0,0 @@ -getAdAccounts([AdAccountFields::ID]); -$account = $accounts[0]; - -$connection_objects = $account->getConnectionObjects([ - ConnectionObjectFields::ID, - ConnectionObjectFields::NAME, - ConnectionObjectFields::OBJECT_STORE_URLS, - ConnectionObjectFields::TYPE, - ConnectionObjectFields::URL, -]); - -// Group the connection objects based on type -$groups = []; - -foreach ($connection_objects as $object) { - if (!isset($groups[$object->type])) { - $groups[$object->type] = []; - } - $groups[$object->type][] = $object; -} - -foreach ($groups as $type => $type_objects) { - $type_name = get_type_name($type); - echo "\n", $type_name, "\n"; - echo str_repeat('=', strlen($type_name)), "\n"; - - foreach ($type_objects as $object) { - render_object($object); - } -} - -function get_type_name($type) { - switch ($type) { - case ConnectionObjectTypes::PAGE: - return 'Page'; - case ConnectionObjectTypes::APPLICATION: - return 'Application'; - case ConnectionObjectTypes::EVENT: - return 'Event'; - case ConnectionObjectTypes::PLACE: - return 'Place'; - case ConnectionObjectTypes::DOMAIN: - return 'Domain'; - default: - return $type; - } -} - -function render_object($object) { - switch ($object->type) { - case ConnectionObjectTypes::APPLICATION: - echo ' - ', $object->id, ' - ', $object->name, "\n"; - foreach ($object->object_store_urls as $store_name => $store_url) { - echo ' ', $store_name, ': ', $store_url, "\n"; - } - return; - - default: - echo ' - ', $object->id, ' - ', $object->name, ' - ', $object->url, "\n"; - return; - } - -} diff --git a/src/FacebookAds/Api.php b/src/FacebookAds/Api.php index 9f5eef6dd..37d5400fd 100644 --- a/src/FacebookAds/Api.php +++ b/src/FacebookAds/Api.php @@ -35,7 +35,7 @@ class Api { /** * @var string */ - const VERSION = '2.5.1'; + const VERSION = '2.6.0'; /** * @var Api diff --git a/src/FacebookAds/Object/AdAccount.php b/src/FacebookAds/Object/AdAccount.php index 7fce26a59..cec1f27fc 100644 --- a/src/FacebookAds/Object/AdAccount.php +++ b/src/FacebookAds/Object/AdAccount.php @@ -156,17 +156,6 @@ public function getBroadCategoryTargeting( ); } - /** - * @param array $fields - * @param array $params - * @return Cursor - */ - public function getConnectionObjects( - array $fields = array(), array $params = array()) { - return $this->getManyByConnection( - ConnectionObject::className(), $fields, $params, 'connectionobjects'); - } - /** * @param array $fields * @param array $params diff --git a/src/FacebookAds/Object/ConnectionObject.php b/src/FacebookAds/Object/ConnectionObject.php deleted file mode 100644 index f9a3af10d..000000000 --- a/src/FacebookAds/Object/ConnectionObject.php +++ /dev/null @@ -1,39 +0,0 @@ -assertCanFetchConnection($account, 'getAdsPixels'); $this->assertCanFetchConnection($account, 'getAdVideos'); $this->assertCanFetchConnection($account, 'getBroadCategoryTargeting'); - $this->assertCanFetchConnection($account, 'getConnectionObjects'); $this->assertCanFetchConnection($account, 'getCustomAudiences'); $this->assertCanFetchConnection($account, 'getConversionPixels'); $this->assertCanFetchConnection($account, 'getPartnerCategories'); diff --git a/test/FacebookAdsTest/Object/DynamicProductAdsAdvertTest.php b/test/FacebookAdsTest/Object/DynamicProductAdsAdvertTest.php index 964385df9..80bf7032a 100644 --- a/test/FacebookAdsTest/Object/DynamicProductAdsAdvertTest.php +++ b/test/FacebookAdsTest/Object/DynamicProductAdsAdvertTest.php @@ -223,7 +223,6 @@ public function testDynamicProductAdsCreation() { TemplateDataFields::LINK => 'http://www.example.com/', TemplateDataFields::MESSAGE => 'Test DPA Ad Message', TemplateDataFields::NAME => '{{product.name | titleize}}', - TemplateDataFields::MAX_PRODUCT_COUNT => 3, TemplateDataFields::CALL_TO_ACTION => array( 'type' => CallToActionTypes::SHOP_NOW ),