Permalink
Browse files

modified attributes for product

  • Loading branch information...
theodorDiaconu authored and iampersistent committed Jan 24, 2013
1 parent ef46ab1 commit ffe8fcf85b8bbaf226dd0890e117f21e981ad39e
Showing with 3 additions and 10 deletions.
  1. +3 −10 lib/Vespolina/Entity/Product/BaseProduct.php
@@ -80,10 +80,9 @@ public function getDescription()
/**
* @inheritdoc
*/
- public function addAttribute(AttributeInterface $attribute)
+ public function addAttribute($attribute, $value)
{
- $type = $attribute->getType();
- $this->attributes[$type] = $attribute;
+ $this->attributes[$attribute] = $value;
return $this;
}
@@ -135,9 +134,6 @@ public function getAttributes()
*/
function removeAttribute($attribute)
{
- if ($attribute instanceof AttributeInterface) {
- $attribute = $attribute->getType();
- }
unset($this->attributes[$attribute]);
return $this;
@@ -148,10 +144,7 @@ function removeAttribute($attribute)
*/
public function setAttributes($attributes)
{
- $this->attributes = array();
- foreach ($attributes as $attribute) {
- $this->addAttribute($attribute);
- }
+ $this->attributes = $attributes;
return $this;
}

0 comments on commit ffe8fcf

Please sign in to comment.