eZ\Publish\Core\Persistence\Legacy\Content\Mapper::extractFieldValueFromRow PHP Method

extractFieldValueFromRow() protected method

Extracts a FieldValue of $type from $row.
protected extractFieldValueFromRow ( array $row, string $type ) : eZ\Publish\SPI\Persistence\Content\FieldValue
$row array
$type string
return eZ\Publish\SPI\Persistence\Content\FieldValue
    protected function extractFieldValueFromRow(array $row, $type)
    {
        $storageValue = new StorageFieldValue();
        // Nullable field
        $storageValue->dataFloat = isset($row['ezcontentobject_attribute_data_float']) ? (double) $row['ezcontentobject_attribute_data_float'] : null;
        // Nullable field
        $storageValue->dataInt = isset($row['ezcontentobject_attribute_data_int']) ? (int) $row['ezcontentobject_attribute_data_int'] : null;
        $storageValue->dataText = $row['ezcontentobject_attribute_data_text'];
        // Not nullable field
        $storageValue->sortKeyInt = (int) $row['ezcontentobject_attribute_sort_key_int'];
        $storageValue->sortKeyString = $row['ezcontentobject_attribute_sort_key_string'];
        $fieldValue = new FieldValue();
        $converter = $this->converterRegistry->getConverter($type);
        $converter->toFieldValue($storageValue, $fieldValue);
        return $fieldValue;
    }