예제 #1
0
 /**
  * @param Attribute $attribute
  */
 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;
 }
예제 #2
0
 public function __construct(Attribute $attribute, string $name)
 {
     $this->name = $name;
     $this->attribute = $attribute;
     $attribute->addValue($this);
 }