private function doMergeIntoProperty($property, $existingValues, $value)
    {
        // TODO: Handle lists!

        if (null === $value) {
            return;
        }

        if (!$this->isValidPropertyValue($value)) {
            throw new \InvalidArgumentException(
                'value must be a scalar, a node, a language-tagged string, or a typed value'
            );
        }

        $normalizedValue = $this->normalizePropertyValue($value);

        foreach ($existingValues as $existing) {
            if ($this->equalValues($existing, $normalizedValue)) {
                return;
            }
        }

        $existingValues[] = $normalizedValue;

        if (1 === count($existingValues)) {
            $existingValues = $existingValues[0];
        }

        $this->properties[$property] = $existingValues;

        if ($normalizedValue instanceof NodeInterface) {
            $value->addReverseProperty($property, $this);
        }
    }
private function doMergeIntoProperty($property, $existingValues, $value)
    {
        // TODO: Handle lists!

        if (null === $value) {
            return;
        }

        if (!$this->isValidPropertyValue($value)) {
            throw new \InvalidArgumentException(
                'value must be a scalar, a node, a language-tagged string, or a typed value'
            );
        }

        $normalizedValue = $this->normalizePropertyValue($value);

        foreach ($existingValues as $existing) {
            if ($this->equalValues($existing, $normalizedValue)) {
                return;
            }
        }

        $existingValues[] = $normalizedValue;

        if (1 === count($existingValues)) {
            $existingValues = $existingValues[0];
        }

        $this->properties[$property] = $existingValues;

        if ($normalizedValue instanceof NodeInterface) {
            $value->addReverseProperty($property, $this);
        }
    }
private function doMergeIntoProperty ( $ property , $ existingValues , $ value ) { // TODO: Handle lists! if ( null === $ value ) { return ; } if ( ! $ this -> isValidPropertyValue ( $ value ) ) { throw new \ InvalidArgumentException ( 'value must be a scalar, a node, a language-tagged string, or a typed value' ) ; } $ normalizedValue = $ this -> normalizePropertyValue ( $ value ) ; foreach ( $ existingValues as $ existing ) { if ( $ this -> equalValues ( $ existing , $ normalizedValue ) ) { return ; } } $ existingValues [ ] = $ normalizedValue ; if ( 1 === count ( $ existingValues ) ) { $ existingValues = $ existingValues [ 0 ] ; } $ this -> properties [ $ property ] = $ existingValues ; if ( $ normalizedValue instanceof NodeInterface ) { $ value -> addReverseProperty ( $ property , $ this ) ; } }
Merge a value into a set of existing values.

@param string $property       The name of the property.
@param array  $existingValues The existing values.
@param mixed  $value          The value to merge into the existing
values. This MUST NOT be an array.

@throws \InvalidArgumentException If value is an array or an object
which is neither a language-tagged
string nor a typed value or a node.
Merge a value into a set of existing values .