mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-28 18:50:11 +02:00
Merge pull request #187 from ftwbzhao/feature/eav
[EAV] Value::setAttribute add return this
This commit is contained in:
@@ -28,12 +28,15 @@ class Value implements ValueInterface
|
||||
|
||||
/**
|
||||
* @param Attribute $attribute
|
||||
* @return $this
|
||||
*/
|
||||
public function setAttribute(Attribute $attribute)
|
||||
{
|
||||
$this->attribute->removeValue($this); // Remove value from current attribute
|
||||
$attribute->addValue($this); // Add value to new attribute
|
||||
$this->attribute = $attribute;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user