PHP Class eZ\Publish\Core\FieldType\BinaryBase\Type

Inheritance: extends eZ\Publish\Core\FieldType\FieldType
Datei anzeigen Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$validatorConfigurationSchema

Public Methods

Method Description
fromHash ( mixed $hash ) : eZ\Publish\Core\FieldType\BinaryBase\Value Converts an $hash to the Value defined by the field type.
fromPersistenceValue ( eZ\Publish\SPI\Persistence\Content\FieldValue $fieldValue ) : eZ\Publish\Core\FieldType\BinaryBase\Value Converts a persistence $fieldValue to a Value.
getName ( eZ\Publish\SPI\FieldType\Value $value ) : string Returns the name of the given field value.
isSearchable ( ) : boolean Returns whether the field type is searchable.
toHash ( eZ\Publish\SPI\FieldType\Value $value ) : mixed Converts a $Value to a hash.
toPersistenceValue ( eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\Persistence\Content\FieldValue Converts a $value to a persistence value.
validate ( eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition, eZ\Publish\SPI\FieldType\Value $fieldValue ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates a field based on the validators in the field definition.
validateValidatorConfiguration ( mixed $validatorConfiguration ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.

Protected Methods

Method Description
checkValueStructure ( Value $value ) Throws an exception if value structure is not of expected format.
completeValue ( Value $value ) Attempts to complete the data in $value.
createValue ( array $inputValue ) : eZ\Publish\Core\FieldType\BinaryBase\Value Creates a specific value of the derived class from $inputValue.
createValueFromInput ( string | array | eZ\Publish\Core\FieldType\BinaryBase\Value $inputValue ) : eZ\Publish\Core\FieldType\BinaryBase\Value Inspects given $inputValue and potentially converts it into a dedicated value object.
getSortInfo ( Value $value ) : boolean BinaryBase does not support sorting.

Method Details

checkValueStructure() protected method

Throws an exception if value structure is not of expected format.
protected checkValueStructure ( Value $value )
$value eZ\Publish\Core\FieldType\Value

completeValue() protected method

Attempts to complete the data in $value.
protected completeValue ( Value $value )
$value eZ\Publish\Core\FieldType\Value

createValue() abstract protected method

Creates a specific value of the derived class from $inputValue.
abstract protected createValue ( array $inputValue ) : eZ\Publish\Core\FieldType\BinaryBase\Value
$inputValue array
return eZ\Publish\Core\FieldType\BinaryBase\Value

createValueFromInput() protected method

Inspects given $inputValue and potentially converts it into a dedicated value object.
protected createValueFromInput ( string | array | eZ\Publish\Core\FieldType\BinaryBase\Value $inputValue ) : eZ\Publish\Core\FieldType\BinaryBase\Value
$inputValue string | array | eZ\Publish\Core\FieldType\BinaryBase\Value
return eZ\Publish\Core\FieldType\BinaryBase\Value The potentially converted and structurally plausible value.

fromHash() public method

Converts an $hash to the Value defined by the field type.
public fromHash ( mixed $hash ) : eZ\Publish\Core\FieldType\BinaryBase\Value
$hash mixed
return eZ\Publish\Core\FieldType\BinaryBase\Value $value

fromPersistenceValue() public method

This method builds a field type value from the $data and $externalData properties.
public fromPersistenceValue ( eZ\Publish\SPI\Persistence\Content\FieldValue $fieldValue ) : eZ\Publish\Core\FieldType\BinaryBase\Value
$fieldValue eZ\Publish\SPI\Persistence\Content\FieldValue
return eZ\Publish\Core\FieldType\BinaryBase\Value

getName() public method

It will be used to generate content name and url alias if current field is designated to be used in the content name/urlAlias pattern.
public getName ( eZ\Publish\SPI\FieldType\Value $value ) : string
$value eZ\Publish\SPI\FieldType\Value
return string

getSortInfo() protected method

BinaryBase does not support sorting.
protected getSortInfo ( Value $value ) : boolean
$value eZ\Publish\Core\FieldType\Value
return boolean

isSearchable() public method

Returns whether the field type is searchable.
public isSearchable ( ) : boolean
return boolean

toHash() public method

Converts a $Value to a hash.
public toHash ( eZ\Publish\SPI\FieldType\Value $value ) : mixed
$value eZ\Publish\SPI\FieldType\Value
return mixed

toPersistenceValue() public method

In this method the field type puts the data which is stored in the field of content in the repository into the property FieldValue::data. The format of $data is a primitive, an array (map) or an object, which is then canonically converted to e.g. json/xml structures by future storage engines without further conversions. For mapping the $data to the legacy database an appropriate Converter (implementing eZ\Publish\Core\Persistence\Legacy\FieldValue\Converter) has implemented for the field type. Note: $data should only hold data which is actually stored in the field. It must not hold data which is stored externally. The $externalData property in the FieldValue is used for storing data externally by the FieldStorage interface method storeFieldData. The FieldValuer::sortKey is build by the field type for using by sort operations.
See also: eZ\Publish\SPI\Persistence\Content\FieldValue
public toPersistenceValue ( eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\Persistence\Content\FieldValue
$value eZ\Publish\SPI\FieldType\Value The value of the field type
return eZ\Publish\SPI\Persistence\Content\FieldValue the value processed by the storage engine

validate() public method

Validates a field based on the validators in the field definition.
public validate ( eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition, eZ\Publish\SPI\FieldType\Value $fieldValue ) : eZ\Publish\SPI\FieldType\ValidationError[]
$fieldDefinition eZ\Publish\API\Repository\Values\ContentType\FieldDefinition The field definition of the field
$fieldValue eZ\Publish\SPI\FieldType\Value The field value for which an action is performed
return eZ\Publish\SPI\FieldType\ValidationError[]

validateValidatorConfiguration() public method

Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.
public validateValidatorConfiguration ( mixed $validatorConfiguration ) : eZ\Publish\SPI\FieldType\ValidationError[]
$validatorConfiguration mixed
return eZ\Publish\SPI\FieldType\ValidationError[]

Property Details

$validatorConfigurationSchema protected_oe property

See also: eZ\Publish\Core\FieldType::$validatorConfigurationSchema
protected $validatorConfigurationSchema