mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-07 06:24:55 +02:00
Merge pull request #187 from ftwbzhao/feature/eav
[EAV] Value::setAttribute add return this
This commit is contained in:
commit
24d3862ca6
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user