diff --git a/src/Google/AdsApi/AdWords/Shopping/v201702/ProductPartitions.php b/src/Google/AdsApi/AdWords/Shopping/v201702/ProductPartitions.php index 7089e75bf..c779aa468 100755 --- a/src/Google/AdsApi/AdWords/Shopping/v201702/ProductPartitions.php +++ b/src/Google/AdsApi/AdWords/Shopping/v201702/ProductPartitions.php @@ -241,7 +241,9 @@ public static function showAdGroupTree(AdWordsServices $adWordsServices, if ($page->getEntries() !== null) { $totalNumEntries = $page->getTotalNumEntries(); foreach ($page->getEntries() as $adGroupCriterion) { - $children[$adGroupCriterion->getCriterion()->getId()] = []; + if (!array_key_exists($adGroupCriterion->getCriterion()->getId(), $children)) { + $children[$adGroupCriterion->getCriterion()->getId()] = []; + } if ($adGroupCriterion->getCriterion()->getParentCriterionId() !== null) { diff --git a/src/Google/AdsApi/AdWords/Shopping/v201705/ProductPartitions.php b/src/Google/AdsApi/AdWords/Shopping/v201705/ProductPartitions.php index 049b51152..67a0552f8 100755 --- a/src/Google/AdsApi/AdWords/Shopping/v201705/ProductPartitions.php +++ b/src/Google/AdsApi/AdWords/Shopping/v201705/ProductPartitions.php @@ -241,7 +241,9 @@ public static function showAdGroupTree(AdWordsServices $adWordsServices, if ($page->getEntries() !== null) { $totalNumEntries = $page->getTotalNumEntries(); foreach ($page->getEntries() as $adGroupCriterion) { - $children[$adGroupCriterion->getCriterion()->getId()] = []; + if (!array_key_exists($adGroupCriterion->getCriterion()->getId(), $children)) { + $children[$adGroupCriterion->getCriterion()->getId()] = []; + } if ($adGroupCriterion->getCriterion()->getParentCriterionId() !== null) { diff --git a/src/Google/AdsApi/AdWords/Shopping/v201708/ProductPartitions.php b/src/Google/AdsApi/AdWords/Shopping/v201708/ProductPartitions.php index a506139d3..ed00a048e 100755 --- a/src/Google/AdsApi/AdWords/Shopping/v201708/ProductPartitions.php +++ b/src/Google/AdsApi/AdWords/Shopping/v201708/ProductPartitions.php @@ -241,7 +241,9 @@ public static function showAdGroupTree(AdWordsServices $adWordsServices, if ($page->getEntries() !== null) { $totalNumEntries = $page->getTotalNumEntries(); foreach ($page->getEntries() as $adGroupCriterion) { - $children[$adGroupCriterion->getCriterion()->getId()] = []; + if (!array_key_exists($adGroupCriterion->getCriterion()->getId(), $children)) { + $children[$adGroupCriterion->getCriterion()->getId()] = []; + } if ($adGroupCriterion->getCriterion()->getParentCriterionId() !== null) { diff --git a/src/Google/AdsApi/AdWords/Shopping/v201710/ProductPartitions.php b/src/Google/AdsApi/AdWords/Shopping/v201710/ProductPartitions.php index 16f1cc605..52e8a5ca1 100755 --- a/src/Google/AdsApi/AdWords/Shopping/v201710/ProductPartitions.php +++ b/src/Google/AdsApi/AdWords/Shopping/v201710/ProductPartitions.php @@ -241,7 +241,9 @@ public static function showAdGroupTree(AdWordsServices $adWordsServices, if ($page->getEntries() !== null) { $totalNumEntries = $page->getTotalNumEntries(); foreach ($page->getEntries() as $adGroupCriterion) { - $children[$adGroupCriterion->getCriterion()->getId()] = []; + if (!array_key_exists($adGroupCriterion->getCriterion()->getId(), $children)) { + $children[$adGroupCriterion->getCriterion()->getId()] = []; + } if ($adGroupCriterion->getCriterion()->getParentCriterionId() !== null) {