eZPublishCommunityProject  2013.6
eZ\Publish\Core\FieldType\BinaryBase\Type Class Reference

Base FileType class for Binary field types (i.e. More...

+ Inheritance diagram for eZ\Publish\Core\FieldType\BinaryBase\Type:
+ Collaboration diagram for eZ\Publish\Core\FieldType\BinaryBase\Type:

Public Member Functions

 fromHash ($hash)
 Converts an $hash to the Value defined by the field type. More...
 
 fromPersistenceValue (FieldValue $fieldValue)
 Converts a persistence $fieldValue to a Value. More...
 
 getName ($value)
 Returns the name of the given field value. More...
 
 isSearchable ()
 Returns whether the field type is searchable. More...
 
 toHash ($value)
 Converts a $Value to a hash. More...
 
 toPersistenceValue ($value)
 Converts a $value to a persistence value. More...
 
 validate (FieldDefinition $fieldDefinition, $fieldValue)
 Validates a field based on the validators in the field definition. More...
 
 validateValidatorConfiguration ($validatorConfiguration)
 Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. More...
 
- Public Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
 acceptValue ($inputValue)
 Potentially builds and checks the type and structure of the $inputValue. More...
 
 applyDefaultSettings (&$fieldSettings)
 Applies the default values to the fieldSettings of a FieldDefinitionCreateStruct. More...
 
 fieldSettingsFromHash ($fieldSettingsHash)
 Converts the given $fieldSettingsHash to field settings of the type. More...
 
 fieldSettingsToHash ($fieldSettings)
 Converts the given $fieldSettings to a simple hash format. More...
 
 fromPersistenceValue (FieldValue $fieldValue)
 Converts a persistence $fieldValue to a Value. More...
 
 getRelations ($fieldValue)
 Returns relation data extracted from value. More...
 
 getSettingsSchema ()
 Returns a schema for the settings expected by the FieldType. More...
 
 getValidatorConfigurationSchema ()
 Returns a schema for the validator configuration expected by the FieldType. More...
 
 isEmptyValue ($value)
 Returns if the given $value is considered empty by the field type. More...
 
 isSearchable ()
 Returns whether the field type is searchable. More...
 
 toPersistenceValue ($value)
 Converts a $value to a persistence value. More...
 
 validate (FieldDefinition $fieldDefinition, $fieldValue)
 Validates a field based on the validators in the field definition. More...
 
 validateFieldSettings ($fieldSettings)
 Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. More...
 
 validateValidatorConfiguration ($validatorConfiguration)
 Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. More...
 
 validatorConfigurationFromHash ($validatorConfigurationHash)
 Converts the given $validatorConfigurationHash to a validator configuration of the type. More...
 
 validatorConfigurationToHash ($validatorConfiguration)
 Converts the given $validatorConfiguration to a simple hash format. More...
 
- Public Member Functions inherited from eZ\Publish\API\Repository\FieldType
 getEmptyValue ()
 Returns the empty value for this field type. More...
 
 getFieldTypeIdentifier ()
 Returns the field type identifier for this field type. More...
 

Protected Member Functions

 completeValue ($value)
 Attempts to complete the data in $value. More...
 
 createValue (array $inputValue)
 Creates a specific value of the derived class from $inputValue. More...
 
 getSortInfo ($value)
 BinaryBase does not support sorting. More...
 
 internalAcceptValue ($inputValue)
 Implements the core of {. More...
 
- Protected Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
 getSortInfo ($value)
 Returns information for FieldValue->$sortKey relevant to the field type. More...
 
 internalAcceptValue ($inputValue)
 Implements the core of {. More...
 

Protected Attributes

 $validatorConfigurationSchema
 
- Protected Attributes inherited from eZ\Publish\Core\FieldType\FieldType
 $settingsSchema = array()
 
 $validatorConfigurationSchema = array()
 

Detailed Description

Base FileType class for Binary field types (i.e.

BinaryBase & Media)

Member Function Documentation

eZ\Publish\Core\FieldType\BinaryBase\Type::completeValue (   $value)
protected

Attempts to complete the data in $value.

Parameters
Value$value
Returns
void

Referenced by eZ\Publish\Core\FieldType\BinaryBase\Type\internalAcceptValue().

eZ\Publish\Core\FieldType\BinaryBase\Type::createValue ( array  $inputValue)
abstractprotected

Creates a specific value of the derived class from $inputValue.

Parameters
array$inputValue
Returns
Value

Referenced by eZ\Publish\Core\FieldType\BinaryBase\Type\fromHash(), and eZ\Publish\Core\FieldType\BinaryBase\Type\internalAcceptValue().

eZ\Publish\Core\FieldType\BinaryBase\Type::fromHash (   $hash)

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

Parameters
mixed$hash
Returns
$value

Implements eZ\Publish\API\Repository\FieldType.

Referenced by eZ\Publish\Core\FieldType\BinaryBase\Type\fromPersistenceValue().

eZ\Publish\Core\FieldType\BinaryBase\Type::fromPersistenceValue ( FieldValue  $fieldValue)

Converts a persistence $fieldValue to a Value.

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

Parameters
\eZ\Publish\SPI\Persistence\Content\FieldValue$fieldValue
Returns
eZ\Publish\Core\FieldType\BinaryBase\Type::getName (   $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
mixed$value
Returns
mixed

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\FieldType\BinaryBase\Type::getSortInfo (   $value)
protected

BinaryBase does not support sorting.

Returns
boolean

Referenced by eZ\Publish\Core\FieldType\BinaryBase\Type\toPersistenceValue().

eZ\Publish\Core\FieldType\BinaryBase\Type::internalAcceptValue (   $inputValue)
protected

Implements the core of {.

See Also
acceptValue()}.
Parameters
mixed$inputValue
Returns
The potentially converted and structurally plausible value.
eZ\Publish\Core\FieldType\BinaryBase\Type::isSearchable ( )

Returns whether the field type is searchable.

Returns
boolean

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\FieldType\BinaryBase\Type::toHash (   $value)

Converts a $Value to a hash.

Parameters
\eZ\Publish\Core\FieldType\BinaryBase\Value$value
Returns
mixed

Implements eZ\Publish\API\Repository\FieldType.

Referenced by eZ\Publish\Core\FieldType\BinaryBase\Type\toPersistenceValue().

eZ\Publish\Core\FieldType\BinaryBase\Type::toPersistenceValue (   $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) 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
Parameters
mixed$valueThe value of the field type
Returns
the value processed by the storage engine
eZ\Publish\Core\FieldType\BinaryBase\Type::validate ( FieldDefinition  $fieldDefinition,
  $fieldValue 
)

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

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
Parameters
\eZ\Publish\API\Repository\Values\ContentType\FieldDefinition$fieldDefinitionThe field definition of the field
\eZ\Publish\Core\FieldType\Value$fieldValueThe field value for which an action is performed
Returns
[]
eZ\Publish\Core\FieldType\BinaryBase\Type::validateValidatorConfiguration (   $validatorConfiguration)

Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.

Parameters
mixed$validatorConfiguration
Returns
[]

Member Data Documentation

eZ\Publish\Core\FieldType\BinaryBase\Type::$validatorConfigurationSchema
protected
Initial value:
= array(
"FileSizeValidator" => array(
'maxFileSize' => array(
'type' => 'int',
'default' => false,
)
)
)
See Also
eZ::$validatorConfigurationSchema

The documentation for this class was generated from the following file: