Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | Static Private Member Functions | Private Attributes | List of all members
eZImageType Class Reference

The class eZImageType handles image accounts and association with content objects. More...

Inheritance diagram for eZImageType:

## Public Member Functions
| __construct ()
| initializeObjectAttribute ( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
| trashStoredObjectAttribute ( $contentObjectAttribute, $version=null)
| restoreTrashedObjectAttribute ( $contentObjectAttribute)
| validateObjectAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| fetchObjectAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| storeObjectAttribute ( $contentObjectAttribute)
| isHTTPFileInsertionSupported ()
| isRegularFileInsertionSupported ()
| insertHTTPFile ( $object, $objectVersion, $objectLanguage, $objectAttribute, $httpFile, $mimeData, &$result)
| insertRegularFile ( $object, $objectVersion, $objectLanguage, $objectAttribute, $filePath, &$result)
| hasStoredFileInformation ( $object, $objectVersion, $objectLanguage, $objectAttribute)
| storedFileInformation ( $object, $objectVersion, $objectLanguage, $objectAttribute)
| fetchClassAttributeHTTPInput ( $http, $base, $classAttribute)
| customObjectAttributeHTTPAction ( $http, $action, $contentObjectAttribute, $parameters)
| title ( $contentObjectAttribute, $name='original_filename')
| hasObjectAttributeContent ( $contentObjectAttribute)
| objectAttributeContent ( $contentObjectAttribute)
| metaData ( $contentObjectAttribute)
| serializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| unserializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| serializeContentObjectAttribute ( $package, $objectAttribute)
| unserializeContentObjectAttribute ( $package, $objectAttribute, $attributeNode)
| toString ( $objectAttribute)
| supportsBatchInitializeObjectAttribute ()
| postStore ( $objectAttribute)
Public Member Functions inherited from eZDataType
| __construct ( $dataTypeString, $name, $properties=array())
| eZDataType ( $dataTypeString, $name, $properties=array())
| viewTemplate ( $contentobjectAttribute)
| editTemplate ( $contentobjectAttribute)
| informationTemplate ( $contentobjectAttribute)
| resultTemplate (&$collectionAttribute)
| isA ()
| isTranslatable ()
| attributes ()
| hasAttribute ( $attr)
| attribute ( $attr)
| isSimpleStringInsertionSupported ()
| isRelationType ()
| insertSimpleString ( $object, $objectVersion, $objectLanguage, $objectAttribute, $string, &$result)
| handleDownload ( $object, $objectVersion, $objectLanguage, $objectAttribute)
| productOptionInformation ( $objectAttribute, $optionID, $productItem)
| objectDisplayInformation ( $objectAttribute, $mergeInfo=false)
| classDisplayInformation ( $classAttribute, $mergeInfo=false)
| classAttributeContent ( $classAttribute)
| onPublish ( $contentObjectAttribute, $contentObject, $publishedNodes)
| preStoreClassAttribute ( $classAttribute, $version)
| storeClassAttribute ( $classAttribute, $version)
| storeDefinedClassAttribute ( $classAttribute)
| storeModifiedClassAttribute ( $classAttribute)
| storeVersionedClassAttribute ( $classAttribute, $version)
| preStoreDefinedClassAttribute ( $classAttribute)
| preStoreModifiedClassAttribute ( $classAttribute)
| preStoreVersionedClassAttribute ( $classAttribute, $version)
| validateClassAttributeHTTPInput ( $http, $base, $classAttribute)
| fixupClassAttributeHTTPInput ( $http, $base, $classAttribute)
| customClassAttributeHTTPAction ( $http, $action, $classAttribute)
| fetchActionValue ( $action, $actionName, &$value)
| fixupObjectAttributeHTTPInput ( $http, $base, $objectAttribute)
| validateCollectionAttributeHTTPInput ( $http, $base, $objectAttribute)
| fixupCollectionAttributeHTTPInput ( $http, $base, $objectAttribute)
| fetchCollectionAttributeHTTPInput ( $collection, $collectionAttribute, $http, $base, $objectAttribute)
| handleCustomObjectHTTPActions ( $http, $attributeDataBaseName, $customActionAttributeArray, $customActionParameters)
| initializeClassAttribute ( $classAttribute)
| cloneClassAttribute ( $oldClassAttribute, $newClassAttribute)
| repairContentObjectAttribute ( $contentObjectAttribute)
| postInitializeObjectAttribute ( $objectAttribute, $currentVersion, $originalContentObjectAttribute)
| deleteStoredObjectAttribute ( $objectAttribute, $version=null)
| deleteStoredClassAttribute ( $classAttribute, $version=null)
| deleteNotVersionedStoredClassAttribute (eZContentClassAttribute $classAttribute)
| contentActionList ( $classAttribute)
| hasInformationCollection ()
| isIndexable ()
| isAddToBasketValidationRequired ()
| validateAddToBasket ( $objectAttribute, $data, &$errors)
| isClassAttributeRemovable ( $classAttribute)
| classAttributeRemovableInformation ( $classAttribute, $includeAll=true)
| isInformationCollector ()
| sortKey ( $objectAttribute)
| sortKeyType ()
| customSorting ()
| customSortingSQL ( $params)
| fromString ( $objectAttribute, $string)
| templateList ()
| postUnserializeContentObjectAttribute ( $package, $objectAttribute)
| removeRelatedObjectItem ( $contentObjectAttribute, $objectID)
| fixRelatedObjectItem ( $contentObjectAttribute, $objectID, $mode)
| createContentObjectAttributeDOMNode ( $objectAttribute)
| diff ( $old, $new, $options=false)
| getDBAFileName ()
| getDBAFilePath ( $checkExtensions=true)
| getDBAExtensionFilePath ()
| importDBDataFromDBAFile ( $dbaFilePath=false)
| batchInitializeObjectAttributeData ( $classAttribute)

## Public Attributes
const | FILESIZE_FIELD = 'data_int1'
const | FILESIZE_VARIABLE = '_ezimage_max_filesize_'
const | DATA_TYPE_STRING = "ezimage"
Public Attributes inherited from eZDataType
| $Attributes
| $DataTypeString
| The datatype string ID, used for uniquely identifying a datatype. More...
| $Name
| The descriptive name of the datatype, usually used for displaying to the user. More...

## Static Private Member Functions
static | validateImageFileExtension ($filename)

## Private Attributes
| $FileExtensionBlackListValidator

## Additional Inherited Members
Static Public Member Functions inherited from eZDataType
static | create ( $dataTypeString)
static | registeredDataTypes ()
static | register ( $dataTypeString, $className)
static | allowedTypes ()
static | loadAndRegisterAllTypes ()
static | loadAndRegisterType ( $type)

## Detailed Description

The class eZImageType handles image accounts and association with content objects.

Note
  The method initializeObjectAttribute was removed in 3.8, the new storage technique removes the need to have it.

Definition at line 20 of file ezimagetype.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZImageType::__construct | ( |  | ) |

Definition at line 26 of file ezimagetype.php.

References ezpI18n\tr().

## Member Function Documentation

## ◆ customObjectAttributeHTTPAction()

eZImageType::customObjectAttributeHTTPAction | ( |  | $http,
|  |  | $action,
|  |  | $objectAttribute,
|  |  | $parameters
| ) |  |

Executes a custom action for an object attribute which was defined on the web page.

Note
  Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 496 of file ezimagetype.php.

References eZDataType\deleteStoredObjectAttribute().

## ◆ fetchClassAttributeHTTPInput()

eZImageType::fetchClassAttributeHTTPInput | ( |  | $http,
|  |  | $base,
|  |  | $classAttribute
| ) |  |

Fetches the HTTP input for the content class attribute.

Note
  Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 484 of file ezimagetype.php.

## ◆ fetchObjectAttributeHTTPInput()

eZImageType::fetchObjectAttributeHTTPInput | ( |  | $http,
|  |  | $base,
|  |  | $contentObjectAttribute
| ) |  |

Fetch object attribute http input, override the ezDataType method This method is triggered when submiting a http form which includes Image class Image is stored into file system every time there is a file input and validation result is valid.

Parameters

  $http | http object
  $base |
  $contentObjectAttribute | : the content object attribute being handled

Returns
  true if content object is not null, false if content object is null

Reimplemented from eZDataType.

Definition at line 298 of file ezimagetype.php.

References eZHTTPFile\canFetch(), and eZHTTPFile\fetch().

## ◆ hasObjectAttributeContent()

eZImageType::hasObjectAttributeContent | ( |  | $contentObjectAttribute | ) |

Returns
  `true` if the datatype finds any content in the attribute $contentObjectAttribute.

Reimplemented from eZDataType.

Definition at line 526 of file ezimagetype.php.

## ◆ hasStoredFileInformation()

eZImageType::hasStoredFileInformation | ( |  | $object,
|  |  | $objectVersion,
|  |  | $objectLanguage,
|  |  | $objectAttribute
| ) |  |

We support file information

Reimplemented from eZDataType.

Definition at line 420 of file ezimagetype.php.

## ◆ initializeObjectAttribute()

eZImageType::initializeObjectAttribute | ( |  | $objectAttribute,
|  |  | $currentVersion,
|  |  | $originalContentObjectAttribute
| ) |  |

Initializes the object attribute with some data.

Parameters

  eZContentObjectAttribute | $objectAttribute |
  int | $currentVersion |
  eZContentObjectAttribute | $originalContentObjectAttribute |

Reimplemented from eZDataType.

Definition at line 33 of file ezimagetype.php.

## ◆ insertHTTPFile()

eZImageType::insertHTTPFile | ( |  | $object,
|  |  | $objectVersion,
|  |  | $objectLanguage,
|  |  | $objectAttribute,
|  |  | $httpFile,
|  |  | $mimeData,
|  | & | $result
| ) |  |

Inserts the file using the Image Handler eZImageAliasHandler.

Reimplemented from eZDataType.

Definition at line 374 of file ezimagetype.php.

References ezpI18n\tr().

## ◆ insertRegularFile()

eZImageType::insertRegularFile | ( |  | $object,
|  |  | $objectVersion,
|  |  | $objectLanguage,
|  |  | $objectAttribute,
|  |  | $filePath,
|  | & | $result
| ) |  |

Inserts the file using the Image Handler eZImageAliasHandler.

Reimplemented from eZDataType.

Definition at line 397 of file ezimagetype.php.

References ezpI18n\tr().

## ◆ isHTTPFileInsertionSupported()

eZImageType::isHTTPFileInsertionSupported | ( |  | ) |

HTTP file insertion is supported.

Reimplemented from eZDataType.

Definition at line 358 of file ezimagetype.php.

## ◆ isRegularFileInsertionSupported()

eZImageType::isRegularFileInsertionSupported | ( |  | ) |

Regular file insertion is supported.

Reimplemented from eZDataType.

Definition at line 366 of file ezimagetype.php.

## ◆ metaData()

eZImageType::metaData | ( |  | $contentObjectAttribute | ) |

Returns
  the text which should be indexed in the search engine. An associative array can be returned to enable searching in specific parts of the data. E.g. array( 'first_column' => "foo", 'second_column' => "bar" );

Reimplemented from eZDataType.

Definition at line 541 of file ezimagetype.php.

## ◆ objectAttributeContent()

eZImageType::objectAttributeContent | ( |  | $objectAttribute | ) |

Returns the content data for the given content object attribute.

Reimplemented from eZDataType.

Definition at line 534 of file ezimagetype.php.

## ◆ postStore()

eZImageType::postStore | ( |  | $objectAttribute | ) |

Iterates over images referenced in data_text, and adds eZImageFile references

Parameters

  eZContentObjectAttribute | $objectAttribute |

Reimplemented from eZDataType.

Definition at line 655 of file ezimagetype.php.

References eZImageFile\appendFilepath().

## ◆ restoreTrashedObjectAttribute()

eZImageType::restoreTrashedObjectAttribute | ( |  | $objectAttribute | ) |

Restores the content object attribute $objectAttribute from trash Default implementation does nothing

Parameters

  eZContentObjectAttribute | $objectAttribute |

Reimplemented from eZDataType.

Definition at line 119 of file ezimagetype.php.

References eZImageFile\definition(), eZImageFile\fetchByFilepath(), eZPersistentObject\fetchObjectList(), and eZClusterFileHandler\instance().

## ◆ serializeContentClassAttribute()

eZImageType::serializeContentClassAttribute | ( |  | $classAttribute,
|  |  | $attributeNode,
|  |  | $attributeParametersNode
| ) |  |

Adds the necessary dom structure to the attribute parameters.

Note
  The default is to add unsupported='true' to the attribute node, meaning that the datatype does not support serializing.

Reimplemented from eZDataType.

Definition at line 549 of file ezimagetype.php.

## ◆ serializeContentObjectAttribute()

eZImageType::serializeContentObjectAttribute | ( |  | $package,
|  |  | $objectAttribute
| ) |  |

Returns
  a DOM representation of the content object attribute

Reimplemented from eZDataType.

Definition at line 572 of file ezimagetype.php.

References eZDataType\createContentObjectAttributeDOMNode().

## ◆ storedFileInformation()

eZImageType::storedFileInformation | ( |  | $object,
|  |  | $objectVersion,
|  |  | $objectLanguage,
|  |  | $objectAttribute
| ) |  |

Extracts file information for the image entry.

Reimplemented from eZDataType.

Definition at line 429 of file ezimagetype.php.

## ◆ storeObjectAttribute()

eZImageType::storeObjectAttribute | ( |  | $objectAttribute | ) |

Stores the datatype data to the database which is related to the object attribute.

Returns
  True if the value was stored correctly.

Note
  The method is entirely up to the datatype, for instance it could reuse the available types in the the attribute or store in a separate object.

See also
  fetchObjectAttributeHTTPInput

Reimplemented from eZDataType.

Definition at line 336 of file ezimagetype.php.

## ◆ supportsBatchInitializeObjectAttribute()

eZImageType::supportsBatchInitializeObjectAttribute | ( |  | ) |

Reimplemented from eZDataType.

Definition at line 646 of file ezimagetype.php.

## ◆ title()

eZImageType::title | ( |  | $contentObjectAttribute,
|  |  | $name = `'original_filename'`
| ) |  |

Will return one of the following items from the original alias.

- alternative_text - If it's not empty
- Default paramater in $name if it exists
- original_filename, this is the default fallback.

Reimplemented from eZDataType.

Definition at line 510 of file ezimagetype.php.

## ◆ toString()

eZImageType::toString | ( |  | $objectAttribute | ) |

Returns
  string representation of an contentobjectattribute data for simplified export

Reimplemented from eZDataType.

Definition at line 619 of file ezimagetype.php.

## ◆ trashStoredObjectAttribute()

eZImageType::trashStoredObjectAttribute | ( |  | $contentObjectAttribute,
|  |  | $version = `null`
| ) |  |

The object is being moved to trash, do any necessary changes to the attribute. Rename file and update db row with new name, so that access to the file using old links no longer works.

Reimplemented from eZDataType.

Definition at line 46 of file ezimagetype.php.

References eZImageFile\definition(), eZImageFile\fetchByFilepath(), eZPersistentObject\fetchObjectList(), and eZClusterFileHandler\instance().

## ◆ unserializeContentClassAttribute()

eZImageType::unserializeContentClassAttribute | ( |  | $classAttribute,
|  |  | $attributeNode,
|  |  | $attributeParametersNode
| ) |  |

Extracts values from the attribute parameters and sets it in the class attribute.

Note
  This function is called after the attribute has been stored and a second store is called after this function is done.

Reimplemented from eZDataType.

Definition at line 560 of file ezimagetype.php.

## ◆ unserializeContentObjectAttribute()

eZImageType::unserializeContentObjectAttribute | ( |  | $package,
|  |  | $objectAttribute,
|  |  | $attributeNode
| ) |  |

Unserialize contentobject attribute

Parameters

  package |
  objectAttribute | contentobject attribute object
  attributeNode | ezdomnode object

Reimplemented from eZDataType.

Definition at line 592 of file ezimagetype.php.

## ◆ validateImageFileExtension()

static eZImageType::validateImageFileExtension | ( |  | $filename | ) |
| static private

Definition at line 280 of file ezimagetype.php.

References eZMimeType\findByURL().

## ◆ validateObjectAttributeHTTPInput()

eZImageType::validateObjectAttributeHTTPInput | ( |  | $http,
|  |  | $base,
|  |  | $contentObjectAttribute
| ) |  |

Validate the object attribute input in http. If there is validation failure, there failure message will be put into $contentObjectAttribute->ValidationError

Parameters

  $http | http object
  $base |
  $contentObjectAttribute | content object attribute being validated

Returns
  validation result- eZInputValidator::STATE_INVALID or eZInputValidator::STATE_ACCEPTED

See also
  kernel/classes/eZDataTypevalidateObjectAttributeHTTPInput($http, $base, $objectAttribute)

Reimplemented from eZDataType.

Definition at line 207 of file ezimagetype.php.

References eZHTTPFile\canFetch(), eZInputValidator\STATE_ACCEPTED, eZInputValidator\STATE_INTERMEDIATE, eZInputValidator\STATE_INVALID, ezpI18n\tr(), eZHTTPFile\UPLOADEDFILE_DOES_NOT_EXIST, eZHTTPFile\UPLOADEDFILE_EXCEEDS_MAX_SIZE, and eZHTTPFile\UPLOADEDFILE_EXCEEDS_PHP_LIMIT.

## Member Data Documentation

## ◆ $FileExtensionBlackListValidator

eZImageType::$FileExtensionBlackListValidator
| private

The file extension blacklist validator

Definition at line 676 of file ezimagetype.php.

## ◆ DATA_TYPE_STRING

const eZImageType::DATA_TYPE_STRING = "ezimage"

Definition at line 24 of file ezimagetype.php.

## ◆ FILESIZE_FIELD

const eZImageType::FILESIZE_FIELD = 'data_int1'

Definition at line 22 of file ezimagetype.php.

## ◆ FILESIZE_VARIABLE

const eZImageType::FILESIZE_VARIABLE = '_ezimage_max_filesize_'

Definition at line 23 of file ezimagetype.php.

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

- ezimagetype.php

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