/**
  * @param ProductOptionValue|string $value
  */
 public function setValue($value)
 {
     if ($value instanceof ProductOptionValue) {
         $productOptionValue = $this->value->getByOptionValueId($value->getOptionValue()->getId());
         if (!is_null($productOptionValue)) {
             $this->value->detach($productOptionValue);
         }
         $this->value->attach($value);
     } else {
         $this->value = $value;
     }
 }