From eaec98126a63ee77aea824c91aca733544917e61 Mon Sep 17 00:00:00 2001 From: Thomas Bachem Date: Sun, 6 Oct 2013 10:53:05 +0200 Subject: [PATCH] Renamed Item::$variation to Item::$category getVariation()/setVariation() are still present for backwards-compatibility but marked as deprecated (thanks to filippo.desantis, https://code.google.com/p/php-ga/issues/detail?id=13) --- .../Internals/Request/ItemRequest.php | 2 +- src/GoogleAnalytics/Item.php | 22 ++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/GoogleAnalytics/Internals/Request/ItemRequest.php b/src/GoogleAnalytics/Internals/Request/ItemRequest.php index cfd668c..7da7c22 100644 --- a/src/GoogleAnalytics/Internals/Request/ItemRequest.php +++ b/src/GoogleAnalytics/Internals/Request/ItemRequest.php @@ -58,7 +58,7 @@ protected function buildParameters() { $p->utmtid = $this->item->getOrderId(); $p->utmipc = $this->item->getSku(); $p->utmipn = $this->item->getName(); - $p->utmiva = $this->item->getVariation(); + $p->utmiva = $this->item->getCategory(); $p->utmipr = $this->item->getPrice(); $p->utmiqt = $this->item->getQuantity(); diff --git a/src/GoogleAnalytics/Item.php b/src/GoogleAnalytics/Item.php index 3e5205c..221e4b9 100644 --- a/src/GoogleAnalytics/Item.php +++ b/src/GoogleAnalytics/Item.php @@ -65,7 +65,7 @@ class Item { * @see Internals\ParameterHolder::$utmiva * @var string */ - protected $variation; + protected $category; /** * Unit Price. Value is set to numbers only (e.g. 19.95), will be mapped to @@ -134,17 +134,33 @@ public function setName($name) { } /** + * @deprecated See getCategory() * @return string */ public function getVariation() { - return $this->variation; + return $this->getCategory(); } /** + * @deprecated See setCategory() * @param string $variation */ public function setVariation($variation) { - $this->variation = $variation; + $this->setCategory($variation); + } + + /** + * @return string + */ + public function getCategory() { + return $this->category; + } + + /** + * @param string $category + */ + public function setCategory($category) { + $this->category = $category; } /**