Skip to content

Commit

Permalink
Renamed Item::$variation to Item::$category
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
thomasbachem committed Oct 6, 2013
1 parent 9a80f73 commit eaec981
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/GoogleAnalytics/Internals/Request/ItemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
22 changes: 19 additions & 3 deletions src/GoogleAnalytics/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit eaec981

Please sign in to comment.