Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

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

The class eZBinaryFileType handles files and association with content objects. More...

Inheritance diagram for eZBinaryFileType:

## Public Member Functions
| __construct ()
| fileHandler ()
| viewTemplate ( $contentobjectAttribute)
| editTemplate ( $contentobjectAttribute)
| informationTemplate ( $contentobjectAttribute)
| initializeObjectAttribute ( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
| trashStoredObjectAttribute ( $contentObjectAttribute, $version=null)
| deleteStoredObjectAttribute ( $contentObjectAttribute, $version=null)
| checkFileUploads ()
| validateObjectAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| fetchObjectAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| storeObjectAttribute ( $contentObjectAttribute)
| customObjectAttributeHTTPAction ( $http, $action, $contentObjectAttribute, $parameters)
| 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)
| handleDownload ( $object, $objectVersion, $objectLanguage, $objectAttribute)
| fetchClassAttributeHTTPInput ( $http, $base, $classAttribute)
| title ( $contentObjectAttribute, $name="original_filename")
| hasObjectAttributeContent ( $contentObjectAttribute)
| objectAttributeContent ( $contentObjectAttribute)
| isIndexable ()
| metaData ( $contentObjectAttribute)
| serializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| unserializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| toString ( $objectAttribute)
| fromString ( $objectAttribute, $string)
| serializeContentObjectAttribute ( $package, $objectAttribute)
| unserializeContentObjectAttribute ( $package, $objectAttribute, $attributeNode)
| supportsBatchInitializeObjectAttribute ()
Public Member Functions inherited from eZDataType
| __construct ( $dataTypeString, $name, $properties=array())
| eZDataType ( $dataTypeString, $name, $properties=array())
| resultTemplate (&$collectionAttribute)
| isA ()
| isTranslatable ()
| attributes ()
| hasAttribute ( $attr)
| attribute ( $attr)
| isSimpleStringInsertionSupported ()
| isRelationType ()
| insertSimpleString ( $object, $objectVersion, $objectLanguage, $objectAttribute, $string, &$result)
| 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)
| postStore ( $objectAttribute)
| restoreTrashedObjectAttribute ( $objectAttribute)
| deleteStoredClassAttribute ( $classAttribute, $version=null)
| deleteNotVersionedStoredClassAttribute (eZContentClassAttribute $classAttribute)
| contentActionList ( $classAttribute)
| hasInformationCollection ()
| isAddToBasketValidationRequired ()
| validateAddToBasket ( $objectAttribute, $data, &$errors)
| isClassAttributeRemovable ( $classAttribute)
| classAttributeRemovableInformation ( $classAttribute, $includeAll=true)
| isInformationCollector ()
| sortKey ( $objectAttribute)
| sortKeyType ()
| customSorting ()
| customSortingSQL ( $params)
| 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 | MAX_FILESIZE_FIELD = 'data_int1'
const | MAX_FILESIZE_VARIABLE = '_ezbinaryfile_max_filesize_'
const | DATA_TYPE_STRING = "ezbinaryfile"
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...

## Private Member Functions
| isDeletingFile (eZHTTPTool $http, eZContentObjectAttribute $contentObjectAttribute)

## 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 eZBinaryFileType handles files and association with content objects.

Definition at line 18 of file ezbinaryfiletype.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZBinaryFileType::__construct | ( |  | ) |

Definition at line 26 of file ezbinaryfiletype.php.

References ezpI18n\tr().

## Member Function Documentation

## ◆ checkFileUploads()

eZBinaryFileType::checkFileUploads | ( |  | ) |

Checks if file uploads are enabled, if not it gives a warning.

Definition at line 220 of file ezbinaryfiletype.php.

References eZError\KERNEL_NOT_AVAILABLE, and ezpI18n\tr().

Referenced by customObjectAttributeHTTPAction(), fetchObjectAttributeHTTPInput(), and validateObjectAttributeHTTPInput().

## ◆ customObjectAttributeHTTPAction()

eZBinaryFileType::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 396 of file ezbinaryfiletype.php.

References checkFileUploads(), and deleteStoredObjectAttribute().

## ◆ deleteStoredObjectAttribute()

eZBinaryFileType::deleteStoredObjectAttribute | ( |  | $contentObjectAttribute,
|  |  | $version = `null`
| ) |  |

Delete stored attribute

Reimplemented from eZDataType.

Definition at line 164 of file ezbinaryfiletype.php.

References eZBinaryFile\fetch(), eZBinaryFile\fetchByFileName(), eZClusterFileHandler\instance(), eZSys\instance(), and eZBinaryFile\removeByID().

Referenced by customObjectAttributeHTTPAction(), and fetchObjectAttributeHTTPInput().

## ◆ editTemplate()

eZBinaryFileType::editTemplate | ( |  | $contentobjectAttribute | ) |

Returns
  the template name to use for editing the attribute.

Note
  Default is to return the datatype string which is OK for most datatypes, if you want dynamic templates reimplement this function and return a template name.
  The returned template name does not include the .tpl extension.

See also
  viewTemplate, informationTemplate

Reimplemented from eZDataType.

Definition at line 62 of file ezbinaryfiletype.php.

References eZDataType\$DataTypeString, and fileHandler().

## ◆ fetchClassAttributeHTTPInput()

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

Fetches the HTTP input for the content class attribute.

Note
  Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 583 of file ezbinaryfiletype.php.

## ◆ fetchObjectAttributeHTTPInput()

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

Fetches the http post var integer input and stores it in the data instance.

Reimplemented from eZDataType.

Definition at line 308 of file ezbinaryfiletype.php.

References eZHTTPFile\canFetch(), checkFileUploads(), eZBinaryFile\create(), deleteStoredObjectAttribute(), eZHTTPFile\fetch(), eZBinaryFile\fetch(), eZMimeType\findByFileContents(), eZClusterFileHandler\instance(), isDeletingFile(), eZInputValidator\STATE_ACCEPTED, eZFile\suffix(), validateObjectAttributeHTTPInput(), and eZDebug\writeError().

## ◆ fileHandler()

eZBinaryFileType::fileHandler | ( |  | ) |

Returns
  the binary file handler.

Definition at line 36 of file ezbinaryfiletype.php.

References eZBinaryFileHandler\instance().

Referenced by editTemplate(), informationTemplate(), and viewTemplate().

## ◆ fromString()

eZBinaryFileType::fromString | ( |  | $objectAttribute,
|  |  | $string
| ) |  |

Reimplemented from eZDataType.

Definition at line 680 of file ezbinaryfiletype.php.

References insertRegularFile().

## ◆ handleDownload()

eZBinaryFileType::handleDownload | ( |  | $object,
|  |  | $objectVersion,
|  |  | $objectLanguage,
|  |  | $objectAttribute
| ) |  |

Updates download count for binary file.

Reimplemented from eZDataType.

Definition at line 563 of file ezbinaryfiletype.php.

References eZBinaryFile\fetch(), and eZDB\instance().

## ◆ hasObjectAttributeContent()

eZBinaryFileType::hasObjectAttributeContent | ( |  | $contentObjectAttribute | ) |

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

Reimplemented from eZDataType.

Definition at line 606 of file ezbinaryfiletype.php.

References eZBinaryFile\fetch().

## ◆ hasStoredFileInformation()

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

We support file information

Reimplemented from eZDataType.

Definition at line 540 of file ezbinaryfiletype.php.

## ◆ informationTemplate()

eZBinaryFileType::informationTemplate | ( |  | $contentobjectAttribute | ) |

Returns
  the template name to use for information collection for the attribute.

Note
  Default is to return the datatype string which is OK for most datatypes, if you want dynamic templates reimplement this function and return a template name.
  The returned template name does not include the .tpl extension.

See also
  viewTemplate, editTemplate

Reimplemented from eZDataType.

Definition at line 80 of file ezbinaryfiletype.php.

References eZDataType\$DataTypeString, and fileHandler().

## ◆ initializeObjectAttribute()

eZBinaryFileType::initializeObjectAttribute | ( |  | $contentObjectAttribute,
|  |  | $currentVersion,
|  |  | $originalContentObjectAttribute
| ) |  |

Sets value according to current version

Reimplemented from eZDataType.

Definition at line 93 of file ezbinaryfiletype.php.

References eZBinaryFile\fetch().

## ◆ insertHTTPFile()

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

Inserts the file using the eZBinaryFile class.

Reimplemented from eZDataType.

Definition at line 426 of file ezbinaryfiletype.php.

References eZBinaryFile\create(), eZBinaryFile\fetch(), eZDB\instance(), eZClusterFileHandler\instance(), and ezpI18n\tr().

## ◆ insertRegularFile()

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

Inserts the file using the eZBinaryFile class.

Reimplemented from eZDataType.

Definition at line 481 of file ezbinaryfiletype.php.

References eZBinaryFile\create(), eZBinaryFile\fetch(), eZMimeType\findByFileContents(), eZClusterFileHandler\instance(), eZDir\mkdir(), eZSys\storageDirectory(), and eZFile\suffix().

Referenced by fromString().

## ◆ isDeletingFile()

eZBinaryFileType::isDeletingFile | ( | eZHTTPTool | $http,
|  | eZContentObjectAttribute | $contentObjectAttribute
| ) |  |
| private

Checks if current HTTP request is asking for current binary file deletion

Parameters

  eZHTTPTool | $http |
  eZContentObjectAttribute | $contentObjectAttribute |

Returns
  bool

Definition at line 781 of file ezbinaryfiletype.php.

References eZContentObjectAttribute\attribute(), eZHTTPTool\hasPostVariable(), and eZHTTPTool\postVariable().

Referenced by fetchObjectAttributeHTTPInput().

## ◆ isHTTPFileInsertionSupported()

eZBinaryFileType::isHTTPFileInsertionSupported | ( |  | ) |

HTTP file insertion is supported.

Reimplemented from eZDataType.

Definition at line 410 of file ezbinaryfiletype.php.

## ◆ isIndexable()

eZBinaryFileType::isIndexable | ( |  | ) |

Returns
  true if the datatype can be indexed

Reimplemented from eZDataType.

Definition at line 627 of file ezbinaryfiletype.php.

## ◆ isRegularFileInsertionSupported()

eZBinaryFileType::isRegularFileInsertionSupported | ( |  | ) |

HTTP file insertion is supported.

Reimplemented from eZDataType.

Definition at line 418 of file ezbinaryfiletype.php.

## ◆ metaData()

eZBinaryFileType::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 632 of file ezbinaryfiletype.php.

## ◆ objectAttributeContent()

eZBinaryFileType::objectAttributeContent | ( |  | $objectAttribute | ) |

Returns the content data for the given content object attribute.

Reimplemented from eZDataType.

Definition at line 615 of file ezbinaryfiletype.php.

References eZBinaryFile\fetch().

## ◆ serializeContentClassAttribute()

eZBinaryFileType::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 644 of file ezbinaryfiletype.php.

## ◆ serializeContentObjectAttribute()

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

Parameters

  package |
  objectAttribute | content attribute

Returns
  a DOM representation of the content object attribute

Reimplemented from eZDataType.

Definition at line 694 of file ezbinaryfiletype.php.

References eZDataType\createContentObjectAttributeDOMNode().

## ◆ storedFileInformation()

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

Extracts file information for the binaryfile entry.

Reimplemented from eZDataType.

Definition at line 549 of file ezbinaryfiletype.php.

References eZBinaryFile\fetch().

## ◆ storeObjectAttribute()

eZBinaryFileType::storeObjectAttribute | ( |  | $contentObjectAttribute | ) |

Does nothing, since the file has been stored. See fetchObjectAttributeHTTPInput for the actual storing.

Reimplemented from eZDataType.

Definition at line 392 of file ezbinaryfiletype.php.

## ◆ supportsBatchInitializeObjectAttribute()

eZBinaryFileType::supportsBatchInitializeObjectAttribute | ( |  | ) |

Reimplemented from eZDataType.

Definition at line 770 of file ezbinaryfiletype.php.

## ◆ title()

eZBinaryFileType::title | ( |  | $contentObjectAttribute,
|  |  | $name = `"original_filename"`
| ) |  |

Returns the object title.

Reimplemented from eZDataType.

Definition at line 595 of file ezbinaryfiletype.php.

References eZBinaryFile\fetch().

## ◆ toString()

eZBinaryFileType::toString | ( |  | $objectAttribute | ) |

Returns
  string representation of an contentobjectattribute data for simplified export

Reimplemented from eZDataType.

Definition at line 666 of file ezbinaryfiletype.php.

## ◆ trashStoredObjectAttribute()

eZBinaryFileType::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 113 of file ezbinaryfiletype.php.

References eZBinaryFile\fetch(), eZBinaryFile\fetchByFileName(), eZClusterFileHandler\instance(), eZSys\instance(), and eZFile\suffix().

## ◆ unserializeContentClassAttribute()

eZBinaryFileType::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 654 of file ezbinaryfiletype.php.

## ◆ unserializeContentObjectAttribute()

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

Unserialize contentobject attribute

Parameters

  package |
  objectAttribute | contentobject attribute object
  attributeNode | ezdomnode object

Reimplemented from eZDataType.

Definition at line 717 of file ezbinaryfiletype.php.

References eZFileHandler\copy(), eZBinaryFile\create(), eZClusterFileHandler\instance(), eZDir\mkdir(), eZSys\storageDirectory(), eZFile\suffix(), eZDebug\writeError(), and eZDebug\writeNotice().

## ◆ validateObjectAttributeHTTPInput()

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

Validates the input and returns true if the input was valid for this datatype.

Reimplemented from eZDataType.

Definition at line 242 of file ezbinaryfiletype.php.

References eZHTTPFile\canFetch(), checkFileUploads(), eZBinaryFile\fetch(), 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.

Referenced by fetchObjectAttributeHTTPInput().

## ◆ viewTemplate()

eZBinaryFileType::viewTemplate | ( |  | $contentobjectAttribute | ) |

Returns
  the template name which the handler decides upon.

Reimplemented from eZDataType.

Definition at line 44 of file ezbinaryfiletype.php.

References eZDataType\$DataTypeString, and fileHandler().

## Member Data Documentation

## ◆ $FileExtensionBlackListValidator

eZBinaryFileType::$FileExtensionBlackListValidator
| private

The file extension blacklist validator

Definition at line 799 of file ezbinaryfiletype.php.

## ◆ DATA_TYPE_STRING

const eZBinaryFileType::DATA_TYPE_STRING = "ezbinaryfile"

Definition at line 24 of file ezbinaryfiletype.php.

## ◆ MAX_FILESIZE_FIELD

const eZBinaryFileType::MAX_FILESIZE_FIELD = 'data_int1'

Definition at line 20 of file ezbinaryfiletype.php.

## ◆ MAX_FILESIZE_VARIABLE

const eZBinaryFileType::MAX_FILESIZE_VARIABLE = '_ezbinaryfile_max_filesize_'

Definition at line 22 of file ezbinaryfiletype.php.

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

- ezbinaryfiletype.php

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