eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\RichTextConverter::toFieldValue PHP Method

toFieldValue() public method

Converts data from $value to $fieldValue.
public toFieldValue ( StorageFieldValue $value, eZ\Publish\SPI\Persistence\Content\FieldValue $fieldValue )
$value eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue
$fieldValue eZ\Publish\SPI\Persistence\Content\FieldValue
    public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue)
    {
        $fieldValue->data = $value->dataText ?: Value::EMPTY_VALUE;
    }

Usage Example

 /**
  * @covers \eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\RichTextConverter::toFieldValue
  */
 public function testToFieldValue()
 {
     $storageFieldValue = new StorageFieldValue();
     $storageFieldValue->dataText = $this->docbookString;
     $fieldValue = new FieldValue();
     $this->converter->toFieldValue($storageFieldValue, $fieldValue);
     self::assertSame($this->docbookString, $fieldValue->data);
 }