eZ\Publish\Core\FieldType\Image\Type::fromPersistenceValue PHP Method

fromPersistenceValue() public method

Converts a persistence $fieldValue to a Value.
public fromPersistenceValue ( eZ\Publish\SPI\Persistence\Content\FieldValue $fieldValue ) : Value
$fieldValue eZ\Publish\SPI\Persistence\Content\FieldValue
return Value
    public function fromPersistenceValue(FieldValue $fieldValue)
    {
        if ($fieldValue->data === null) {
            return $this->getEmptyValue();
        }
        // Restored data comes in $data, since it has already been processed
        // there might be more data in the persistence value than needed here
        $result = $this->fromHash(array('id' => isset($fieldValue->data['id']) ? $fieldValue->data['id'] : null, 'alternativeText' => isset($fieldValue->data['alternativeText']) ? $fieldValue->data['alternativeText'] : null, 'fileName' => isset($fieldValue->data['fileName']) ? $fieldValue->data['fileName'] : null, 'fileSize' => isset($fieldValue->data['fileSize']) ? $fieldValue->data['fileSize'] : null, 'uri' => isset($fieldValue->data['uri']) ? $fieldValue->data['uri'] : null, 'imageId' => isset($fieldValue->data['imageId']) ? $fieldValue->data['imageId'] : null, 'width' => isset($fieldValue->data['width']) ? $fieldValue->data['width'] : null, 'height' => isset($fieldValue->data['height']) ? $fieldValue->data['height'] : null));
        return $result;
    }