eZPublishCommunityProject  2013.4
eZ\Publish\Core\FieldType\Image\Type Class Reference

The Image field type. More...

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

Public Member Functions

 __construct (IOService $IOService)
 Creates a new Image FieldType. More...
 
 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...
 
 getEmptyValue ()
 Returns the fallback default value of field type when no such default value is provided in the field definition in content types. More...
 
 getFieldTypeIdentifier ()
 Returns the field type identifier for this field type. More...
 
 getName ($value)
 Returns the name of the given field value. More...
 
 isEmptyValue ($value)
 Returns if the given $value is considered empty by the field type. 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...
 
 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...
 

Protected Member Functions

 fileExists ($path)
 Returns if the given $path exists on the local disc or in the file storage. More...
 
 getSortInfo ($value)
 
 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

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

Detailed Description

The Image field type.

Constructor & Destructor Documentation

eZ\Publish\Core\FieldType\Image\Type::__construct ( IOService  $IOService)

Creates a new Image FieldType.

Parameters
IOService$IOService

Member Function Documentation

eZ\Publish\Core\FieldType\Image\Type::fileExists (   $path)
protected

Returns if the given $path exists on the local disc or in the file storage.

Parameters
string$path
Returns
boolean
eZ\Publish\Core\FieldType\Image\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\Image\Type\fromPersistenceValue().

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

Converts a persistence $fieldValue to a Value.

Parameters
\eZ\Publish\SPI\Persistence\Content\FieldValue$fieldValue
Returns
mixed
eZ\Publish\Core\FieldType\Image\Type::getEmptyValue ( )

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

Returns

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\FieldType\Image\Type::getFieldTypeIdentifier ( )

Returns the field type identifier for this field type.

Returns
string

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\FieldType\Image\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\Image\Type::getSortInfo (   $value)
protected
See Also
::getSortInfo()
Todo:
Correct?
Returns
boolean

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

eZ\Publish\Core\FieldType\Image\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\Image\Type::isEmptyValue (   $value)

Returns if the given $value is considered empty by the field type.

Parameters
mixed$value
Returns
boolean

Referenced by eZ\Publish\Core\FieldType\Image\Type\toHash().

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

Converts a $Value to a hash.

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

Implements eZ\Publish\API\Repository\FieldType.

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

eZ\Publish\Core\FieldType\Image\Type::toPersistenceValue (   $value)

Converts a $value to a persistence value.

Parameters
mixed$value
Returns
eZ\Publish\Core\FieldType\Image\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\Image\Type::validateValidatorConfiguration (   $validatorConfiguration)

Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.

Parameters
mixed$validatorConfiguration
Returns
[]

Member Data Documentation

eZ\Publish\Core\FieldType\Image\Type::$IOService
protected
eZ\Publish\Core\FieldType\Image\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: