public function removeValueData(AttributeInterface $attribute, $valueData, array $context = null)
    {
        $this->checkAttribute($attribute);
        if (!$attribute->isCollection()) {
            $m = "Cannot remove data from a non-collection attribute '{$attribute->getCode()}'";
            throw new InvalidValueDataException($m);
        }
        foreach ($this->getValues($attribute, $context) as $value) {
            try {
                if ($value->getValueData() === $valueData) {
                    $this->removeValue($value);
                    break;
                }
            } catch (ExceptionInterface $e) {
                throw new InvalidValueDataException("Invalid data for attribute {$attribute->getCode()}", 0, $e);
            }
        }

        return $this;
    }
public function removeValueData(AttributeInterface $attribute, $valueData, array $context = null)
    {
        $this->checkAttribute($attribute);
        if (!$attribute->isCollection()) {
            $m = "Cannot remove data from a non-collection attribute '{$attribute->getCode()}'";
            throw new InvalidValueDataException($m);
        }
        foreach ($this->getValues($attribute, $context) as $value) {
            try {
                if ($value->getValueData() === $valueData) {
                    $this->removeValue($value);
                    break;
                }
            } catch (ExceptionInterface $e) {
                throw new InvalidValueDataException("Invalid data for attribute {$attribute->getCode()}", 0, $e);
            }
        }

        return $this;
    }
public function removeValueData ( AttributeInterface $ attribute , $ valueData , array $ context = null ) { $ this -> checkAttribute ( $ attribute ) ; if ( ! $ attribute -> isCollection ( ) ) { $ m = "Cannot remove data from a non-collection attribute '{$attribute->getCode()}'" ; throw new InvalidValueDataException ( $ m ) ; } foreach ( $ this -> getValues ( $ attribute , $ context ) as $ value ) { try { if ( $ value -> getValueData ( ) === $ valueData ) { $ this -> removeValue ( $ value ) ; break ; } } catch ( ExceptionInterface $ e ) { throw new InvalidValueDataException ( "Invalid data for attribute {$attribute->getCode()}" , 0 , $ e ) ; } } return $ this ; }
Remove a data from an attribute

@param AttributeInterface $attribute
@param mixed              $valueData
@param array|null         $context

@throws InvalidValueDataException
@throws MissingAttributeException
@throws ContextException

@return DataInterface
Remove a data from an attribute