bundle/Factory/FieldDataFactory.php
public function getLegacyValue(Value $value, FieldDefinition $fieldDefinition)
    {
        /** @var CustomFieldHandlerInterface $handler */
        $handler = $this->registry->handle($value);

        if (null === $handler) {

            return new LegacyData(
                $fieldDefinition->id,
                0,
                0,
                (string)$value
            );
        }

        if ($handler instanceof CustomLegacyFieldHandlerInterface) {
            return $handler->getLegacyValue($value, $fieldDefinition);
        }

        return new LegacyData(
            $fieldDefinition->id,
            0,
            0,
            (string) $handler->toString($value, $fieldDefinition)
        );
    }
public function getLegacyValue(Value $value, FieldDefinition $fieldDefinition)
    {
        /** @var CustomFieldHandlerInterface $handler */
        $handler = $this->registry->handle($value);

        if (null === $handler) {

            return new LegacyData(
                $fieldDefinition->id,
                0,
                0,
                (string)$value
            );
        }

        if ($handler instanceof CustomLegacyFieldHandlerInterface) {
            return $handler->getLegacyValue($value, $fieldDefinition);
        }

        return new LegacyData(
            $fieldDefinition->id,
            0,
            0,
            (string) $handler->toString($value, $fieldDefinition)
        );
    }
public function getLegacyValue ( Value $ value , FieldDefinition $ fieldDefinition ) { /** @var CustomFieldHandlerInterface $handler */ $ handler = $ this -> registry -> handle ( $ value ) ; if ( null === $ handler ) { return new LegacyData ( $ fieldDefinition -> id , 0 , 0 , ( string ) $ value ) ; } if ( $ handler instanceof CustomLegacyFieldHandlerInterface ) { return $ handler -> getLegacyValue ( $ value , $ fieldDefinition ) ; } return new LegacyData ( $ fieldDefinition -> id , 0 , 0 , ( string ) $ handler -> toString ( $ value , $ fieldDefinition ) ) ; }
Returns value object that represents legacy value.

@param Value $value
@param FieldDefinition $fieldDefinition

@return LegacyData
Returns value object that represents legacy value .