eZ\Publish\Core\FieldType\FieldType::toPersistenceValue PHP Method

toPersistenceValue() public method

Converts a $value to a persistence value.
public toPersistenceValue ( eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\Persistence\Content\FieldValue
$value eZ\Publish\SPI\FieldType\Value
return eZ\Publish\SPI\Persistence\Content\FieldValue
    public function toPersistenceValue(SPIValue $value)
    {
        // @todo Evaluate if creating the sortKey in every case is really needed
        //       Couldn't this be retrieved with a method, which would initialize
        //       that info on request only?
        return new PersistenceValue(array('data' => $this->toHash($value), 'externalData' => null, 'sortKey' => $this->getSortInfo($value)));
    }