Class

eZ\Publish\Core\FieldType\BinaryFile\Type

class Type extends Type

The TextLine field type.

This field type represents a simple string.

Methods

string getName(Value $value)

Returns the name of the given field value.

from Type
Value fromHash(mixed $hash)

Converts an $hash to the Value defined by the field type.

from Type
mixed toHash(Value $value)

Converts a $Value to a hash.

FieldValue toPersistenceValue(Value $value)

Converts a $value to a persistence value.

from Type
Value fromPersistenceValue(FieldValue $fieldValue)

Converts a persistence $fieldValue to a Value.

ValidationError[] validate(FieldDefinition $fieldDefinition, Value $fieldValue)

Validates a field based on the validators in the field definition.

from Type
ValidationError[] validateValidatorConfiguration(mixed $validatorConfiguration)

Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.

from Type
bool isSearchable()

Returns whether the field type is searchable.

from Type
string getFieldTypeIdentifier()

Returns the field type identifier for this field type.

Value getEmptyValue()

Returns the fallback default value of field type when no such default value is provided in the field definition in content types.

Details

in Type at line 55
public string getName(Value $value)

Returns the name of the given field value.

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.

Parameters

Value $value

Return Value

string

in Type at line 169
public Value fromHash(mixed $hash)

Converts an $hash to the Value defined by the field type.

Parameters

mixed $hash

Return Value

Value $value

at line 77
public mixed toHash(Value $value)

Converts a $Value to a hash.

Parameters

Value $value

Return Value

mixed

in Type at line 221
public FieldValue toPersistenceValue(Value $value)

Converts a $value to a persistence value.

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.

Parameters

Value $value The value of the field type

Return Value

FieldValue the value processed by the storage engine

See also

\eZ\Publish\SPI\Persistence\Content\FieldValue

at line 99
public Value fromPersistenceValue(FieldValue $fieldValue)

Converts a persistence $fieldValue to a Value.

This method builds a field type value from the $data and $externalData properties.

Parameters

FieldValue $fieldValue

Return Value

Value

in Type at line 279
public ValidationError[] validate(FieldDefinition $fieldDefinition, Value $fieldValue)

Validates a field based on the validators in the field definition.

Parameters

FieldDefinition $fieldDefinition The field definition of the field
Value $fieldValue The field value for which an action is performed

Return Value

ValidationError[]

Exceptions

InvalidArgumentException

in Type at line 321
public ValidationError[] validateValidatorConfiguration(mixed $validatorConfiguration)

Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.

Parameters

mixed $validatorConfiguration

Return Value

ValidationError[]

in Type at line 373
public bool isSearchable()

Returns whether the field type is searchable.

Return Value

bool

at line 28
public string getFieldTypeIdentifier()

Returns the field type identifier for this field type.

Return Value

string

at line 39
public Value getEmptyValue()

Returns the fallback default value of field type when no such default value is provided in the field definition in content types.

Return Value

Value