Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
eZ\Publish\Core\FieldType\ImageAsset\Type Class Reference
Inheritance diagram for eZ\Publish\Core\FieldType\ImageAsset\Type:

## Public Member Functions
| __construct (ContentService $contentService, ContentTypeService $contentTypeService, AssetMapper $mapper)
| validate (FieldDefinition $fieldDefinition, SPIValue $fieldValue)
| Validates a field based on the validators in the field definition. More...
| getFieldTypeIdentifier ()
| Returns the field type identifier for this field type. More...
| getName (SPIValue $value)
| Returns the name of the given field 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...
| isEmptyValue (SPIValue $value)
| Returns if the given $value is considered empty by the field type. More...
| fromHash ($hash)
| Converts an $hash to the Value defined by the field type. More...
| toHash (SPIValue $value)
| Converts a $Value to a hash. More...
| getRelations (SPIValue $fieldValue)
| Returns relation data extracted from value. More...
| isSearchable ()
| Returns whether the field type is searchable. More...
Public Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
| setTransformationProcessor (TransformationProcessor $transformationProcessor)
| 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...
| validateValidatorConfiguration ($validatorConfiguration)
| Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. More...
| applyDefaultValidatorConfiguration (&$validatorConfiguration)
| Applies the default values to the given $validatorConfiguration of a FieldDefinitionCreateStruct. More...
| validateFieldSettings ($fieldSettings)
| Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. More...
| applyDefaultSettings (&$fieldSettings)
| Applies the default values to the fieldSettings of a FieldDefinitionCreateStruct. More...
| toPersistenceValue (SPIValue $value)
| Converts a $value to a persistence value. More...
| fromPersistenceValue (PersistenceValue $fieldValue)
| Converts a persistence $fieldValue to a Value. More...
| isSingular ()
| Indicates if the field definition of this type can appear only once in the same ContentType. More...
| onlyEmptyInstance ()
| Indicates if the field definition of this type can be added to a ContentType with Content instances. More...
| acceptValue ($inputValue)
| Potentially builds and checks the type and structure of the $inputValue. More...
| fieldSettingsToHash ($fieldSettings)
| Converts the given $fieldSettings to a simple hash format. More...
| fieldSettingsFromHash ($fieldSettingsHash)
| Converts the given $fieldSettingsHash to field settings of the type. More...
| validatorConfigurationToHash ($validatorConfiguration)
| Converts the given $validatorConfiguration to a simple hash format. More...
| validatorConfigurationFromHash ($validatorConfigurationHash)
| Converts the given $validatorConfigurationHash to a validator configuration of the type. More...
| valuesEqual (SPIValue $value1, SPIValue $value2)
Public Member Functions inherited from eZ\Publish\SPI\FieldType\FieldType
| getName (Value $value)
| Returns a human readable string representation from the given $value. More...
| validate (FieldDefinition $fieldDef, Value $value)
| Validates a field based on the validator configuration in the field definition. More...
| isEmptyValue (Value $value)
| Returns if the given $value is considered empty by the field type. More...
| toHash (Value $value)
| Converts the given $value into a plain hash format. More...
| toPersistenceValue (Value $value)
| Converts a $value to a persistence value. More...
| fromPersistenceValue (FieldValue $fieldValue)
| Converts a persistence $value to a Value. More...
| getRelations (Value $value)
| Returns relation data extracted from value. More...
Public Member Functions inherited from eZ\Publish\SPI\FieldType\Comparable
| valuesEqual (Value $value1, Value $value2)

## Public Attributes
const | FIELD_TYPE_IDENTIFIER = 'ezimageasset'

## Protected Member Functions
| createValueFromInput ($inputValue)
| Inspects given $inputValue and potentially converts it into a dedicated value object. More...
| checkValueStructure (BaseValue $value)
| Throws an exception if value structure is not of expected format. More...
| getSortInfo (BaseValue $value)
| Returns information for FieldValue->$sortKey relevant to the field type. More...
Protected Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
| getSortInfo (Value $value)
| Returns information for FieldValue->$sortKey relevant to the field type. More...
| checkValueStructure (Value $value)
| Throws an exception if value structure is not of expected format. More...

## Private Attributes
| $contentService
| $contentTypeService
| $assetMapper

## Additional Inherited Members
Static Protected Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
static | checkValueType ($value)
| Throws an exception if the given $value is not an instance of the supported value subtype. More...
Protected Attributes inherited from eZ\Publish\Core\FieldType\FieldType
| $settingsSchema = []
| $validatorConfigurationSchema = []
| $transformationProcessor

## Detailed Description

Definition at line 22 of file Core/FieldType/ImageAsset/Type.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\FieldType\ImageAsset\Type::__construct | ( | ContentService | $contentService,
|  | ContentTypeService | $contentTypeService,
|  | AssetMapper | $mapper
| ) |  |

Parameters

  \eZ\Publish\API\Repository\ContentService | $contentService |
  \eZ\Publish\API\Repository\ContentTypeService | $contentTypeService |
  \eZ\Publish\Core\FieldType\ImageAsset\AssetMapper | $mapper |

Definition at line 40 of file Core/FieldType/ImageAsset/Type.php.

References eZ\Publish\Core\FieldType\ImageAsset\Type\$contentService, and eZ\Publish\Core\FieldType\ImageAsset\Type\$contentTypeService.

## Member Function Documentation

## ◆ checkValueStructure()

eZ\Publish\Core\FieldType\ImageAsset\Type::checkValueStructure | ( | BaseValue | $value | ) |
| protected

Throws an exception if value structure is not of expected format.

Exceptions

Definition at line 157 of file Core/FieldType/ImageAsset/Type.php.

## ◆ createValueFromInput()

eZ\Publish\Core\FieldType\ImageAsset\Type::createValueFromInput | ( |  | $inputValue | ) |
| protected

Inspects given $inputValue and potentially converts it into a dedicated value object.

Parameters

  int | string | \eZ\Publish\API\Repository\Values\Content\ContentInfo | \eZ\Publish\Core\FieldType\Relation\Value | $inputValue |

Returns
  \eZ\Publish\Core\FieldType\ImageAsset\Value The potentially converted and structurally plausible value.

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 139 of file Core/FieldType/ImageAsset/Type.php.

## ◆ fromHash()

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

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

Parameters

  mixed | $hash |

Returns
  \eZ\Publish\Core\FieldType\ImageAsset\Value $value

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 196 of file Core/FieldType/ImageAsset/Type.php.

## ◆ getEmptyValue()

eZ\Publish\Core\FieldType\ImageAsset\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
  \eZ\Publish\Core\FieldType\ImageAsset\Value

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 115 of file Core/FieldType/ImageAsset/Type.php.

## ◆ getFieldTypeIdentifier()

eZ\Publish\Core\FieldType\ImageAsset\Type::getFieldTypeIdentifier | ( |  | ) |

Returns the field type identifier for this field type.

Returns
  string

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 89 of file Core/FieldType/ImageAsset/Type.php.

References eZ\Publish\Core\FieldType\ImageAsset\Type\FIELD_TYPE_IDENTIFIER.

## ◆ getName()

eZ\Publish\Core\FieldType\ImageAsset\Type::getName | ( | SPIValue | $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

  \eZ\Publish\Core\FieldType\ImageAsset\Value | $value |

Returns
  string

Definition at line 104 of file Core/FieldType/ImageAsset/Type.php.

## ◆ getRelations()

eZ\Publish\Core\FieldType\ImageAsset\Type::getRelations | ( | SPIValue | $fieldValue | ) |

Returns relation data extracted from value.

Not intended for \eZ\Publish\API\Repository\Values\Content\Relation::COMMON type relations, there is an API for handling those.

Parameters

  \eZ\Publish\Core\FieldType\ImageAsset\Value | $fieldValue |

Returns
  array Hash with relation type as key and array of destination content ids as value.

Example: `array( \eZ\Publish\API\Repository\Values\Content\Relation::LINK => array( "contentIds" => array( 12, 13, 14 ), "locationIds" => array( 24 ) ), \eZ\Publish\API\Repository\Values\Content\Relation::EMBED => array( "contentIds" => array( 12 ), "locationIds" => array( 24, 45 ) ), \eZ\Publish\API\Repository\Values\Content\Relation::FIELD => array( 12 ) )`

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 245 of file Core/FieldType/ImageAsset/Type.php.

References eZ\Publish\API\Repository\Values\Content\Relation\ASSET.

## ◆ getSortInfo()

eZ\Publish\Core\FieldType\ImageAsset\Type::getSortInfo | ( | BaseValue | $value | ) |
| protected

Returns information for FieldValue->$sortKey relevant to the field type.

For this FieldType, the related object's name is returned.

Parameters

  \eZ\Publish\Core\FieldType\Relation\Value | $value |

Returns
  bool

Definition at line 184 of file Core/FieldType/ImageAsset/Type.php.

## ◆ isEmptyValue()

eZ\Publish\Core\FieldType\ImageAsset\Type::isEmptyValue | ( | SPIValue | $value | ) |

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

Parameters

  mixed | $value |

Returns
  bool

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 127 of file Core/FieldType/ImageAsset/Type.php.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\Type\validate().

## ◆ isSearchable()

eZ\Publish\Core\FieldType\ImageAsset\Type::isSearchable | ( |  | ) |

Returns whether the field type is searchable.

Returns
  bool

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 260 of file Core/FieldType/ImageAsset/Type.php.

## ◆ toHash()

eZ\Publish\Core\FieldType\ImageAsset\Type::toHash | ( | SPIValue | $value | ) |

Converts a $Value to a hash.

Parameters

  \eZ\Publish\Core\FieldType\ImageAsset\Value | $value |

Returns
  array

Definition at line 212 of file Core/FieldType/ImageAsset/Type.php.

## ◆ validate()

eZ\Publish\Core\FieldType\ImageAsset\Type::validate | ( | FieldDefinition | $fieldDefinition,
|  | SPIValue | $fieldValue
| ) |  |

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

Parameters

  \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition | $fieldDefinition | The field definition of the field
  \eZ\Publish\Core\FieldType\ImageAsset\Value | $fieldValue | The field value for which an action is performed

Returns
  \eZ\Publish\SPI\FieldType\ValidationError[]

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 58 of file Core/FieldType/ImageAsset/Type.php.

References eZ\Publish\Core\FieldType\ImageAsset\Type\isEmptyValue().

## Member Data Documentation

## ◆ $assetMapper

eZ\Publish\Core\FieldType\ImageAsset\Type::$assetMapper
| private

Definition at line 33 of file Core/FieldType/ImageAsset/Type.php.

## ◆ $contentService

eZ\Publish\Core\FieldType\ImageAsset\Type::$contentService
| private

Definition at line 27 of file Core/FieldType/ImageAsset/Type.php.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\Type\__construct().

## ◆ $contentTypeService

eZ\Publish\Core\FieldType\ImageAsset\Type::$contentTypeService
| private

Definition at line 30 of file Core/FieldType/ImageAsset/Type.php.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\Type\__construct().

## ◆ FIELD_TYPE_IDENTIFIER

const eZ\Publish\Core\FieldType\ImageAsset\Type::FIELD_TYPE_IDENTIFIER = 'ezimageasset'

Definition at line 24 of file Core/FieldType/ImageAsset/Type.php.

Referenced by eZ\Publish\Core\FieldType\ImageAsset\Type\getFieldTypeIdentifier().

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

- Core/FieldType/ImageAsset/Type.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.