public function updateFieldValueValue(FieldValueInterface $fieldValue, $changeSet)
    {
        if (!isset($changeSet['value'])) {
            return;
        }

        $oldValue = unserialize($changeSet['value'][0]);
        $newValue = unserialize($changeSet['value'][1]);

        if ($newValue['src'] == '' && !$newValue['delete']) {
            $newValue['src'] = $oldValue['src'];
        }

        if ($newValue['delete']) {
            $this->uploadManager->remove($oldValue['src']);
        }

        unset($newValue['delete']);

        $fieldValue->setValue(serialize($newValue));
    }
public function updateFieldValueValue(FieldValueInterface $fieldValue, $changeSet)
    {
        if (!isset($changeSet['value'])) {
            return;
        }

        $oldValue = unserialize($changeSet['value'][0]);
        $newValue = unserialize($changeSet['value'][1]);

        if ($newValue['src'] == '' && !$newValue['delete']) {
            $newValue['src'] = $oldValue['src'];
        }

        if ($newValue['delete']) {
            $this->uploadManager->remove($oldValue['src']);
        }

        unset($newValue['delete']);

        $fieldValue->setValue(serialize($newValue));
    }
public function updateFieldValueValue ( FieldValueInterface $ fieldValue , $ changeSet ) { if ( ! isset ( $ changeSet [ 'value' ] ) ) { return ; } $ oldValue = unserialize ( $ changeSet [ 'value' ] [ 0 ] ) ; $ newValue = unserialize ( $ changeSet [ 'value' ] [ 1 ] ) ; if ( $ newValue [ 'src' ] == '' && ! $ newValue [ 'delete' ] ) { $ newValue [ 'src' ] = $ oldValue [ 'src' ] ; } if ( $ newValue [ 'delete' ] ) { $ this -> uploadManager -> remove ( $ oldValue [ 'src' ] ) ; } unset ( $ newValue [ 'delete' ] ) ; $ fieldValue -> setValue ( serialize ( $ newValue ) ) ; }
Update fieldValue value before saving it

@param FieldValueInterface $fieldValue
@param array               $changeSet

@return void
Update fieldValue value before saving it