src/Sulu/Component/Content/Compat/Block/BlockProperty.php
public function doSetValue($value)
    {
        $items = $value;
        if ($value instanceof PropertyValue) {
            $items = $value->getValue();
        }

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

        // check value for single value
        if (array_keys($items) !== range(0, count($items) - 1)) {
            $items = [$items];
        }

        $this->properties = [];

        for ($i = 0; $i < count($items); ++$i) {
            $item = $items[$i];
            $type = $this->initProperties($i, $item['type']);

            /** @var PropertyInterface $subProperty */
            foreach ($type->getChildProperties() as $subProperty) {
                if (!isset($item[$subProperty->getName()])) {
                    continue;
                }

                $subName = $subProperty->getName();
                $subValue = $item[$subName];

                if ($subValue instanceof PropertyValue) {
                    $subValueProperty = new PropertyValue($subName, $subValue);
                    $subProperty->setPropertyValue($subValueProperty);
                    $item[$subName] = $subValueProperty;
                } else {
                    $subProperty->setValue($subValue);
                }
            }

            $items[$i] = $item;
        }

        if ($value instanceof PropertyValue) {
            $value->setValue($items);
        }
    }
public function doSetValue($value)
    {
        $items = $value;
        if ($value instanceof PropertyValue) {
            $items = $value->getValue();
        }

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

        // check value for single value
        if (array_keys($items) !== range(0, count($items) - 1)) {
            $items = [$items];
        }

        $this->properties = [];

        for ($i = 0; $i < count($items); ++$i) {
            $item = $items[$i];
            $type = $this->initProperties($i, $item['type']);

            /** @var PropertyInterface $subProperty */
            foreach ($type->getChildProperties() as $subProperty) {
                if (!isset($item[$subProperty->getName()])) {
                    continue;
                }

                $subName = $subProperty->getName();
                $subValue = $item[$subName];

                if ($subValue instanceof PropertyValue) {
                    $subValueProperty = new PropertyValue($subName, $subValue);
                    $subProperty->setPropertyValue($subValueProperty);
                    $item[$subName] = $subValueProperty;
                } else {
                    $subProperty->setValue($subValue);
                }
            }

            $items[$i] = $item;
        }

        if ($value instanceof PropertyValue) {
            $value->setValue($items);
        }
    }
public function doSetValue ( $ value ) { $ items = $ value ; if ( $ value instanceof PropertyValue ) { $ items = $ value -> getValue ( ) ; } if ( null == $ items ) { return ; } // check value for single value if ( array_keys ( $ items ) !== range ( 0 , count ( $ items ) - 1 ) ) { $ items = [ $ items ] ; } $ this -> properties = [ ] ; for ( $ i = 0 ; $ i < count ( $ items ) ; ++ $ i ) { $ item = $ items [ $ i ] ; $ type = $ this -> initProperties ( $ i , $ item [ 'type' ] ) ; /** @var PropertyInterface $subProperty */ foreach ( $ type -> getChildProperties ( ) as $ subProperty ) { if ( ! isset ( $ item [ $ subProperty -> getName ( ) ] ) ) { continue ; } $ subName = $ subProperty -> getName ( ) ; $ subValue = $ item [ $ subName ] ; if ( $ subValue instanceof PropertyValue ) { $ subValueProperty = new PropertyValue ( $ subName , $ subValue ) ; $ subProperty -> setPropertyValue ( $ subValueProperty ) ; $ item [ $ subName ] = $ subValueProperty ; } else { $ subProperty -> setValue ( $ subValue ) ; } } $ items [ $ i ] = $ item ; } if ( $ value instanceof PropertyValue ) { $ value -> setValue ( $ items ) ; } }
Sub properties need to be referenced to the PropertyValue so
that the "real" property is updated.

TODO: This is very tedious code. It is important to factor this out.
Sub properties need to be referenced to the PropertyValue so that the real property is updated .