Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

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

The class eZMediaType handles storage and playback of media files. More...

Inheritance diagram for eZMediaType:

## Public Member Functions
| __construct ()
| postInitializeObjectAttribute ( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
| trashStoredObjectAttribute ( $contentObjectAttribute, $version=null)
| deleteStoredObjectAttribute ( $contentObjectAttribute, $version=null)
| validateObjectAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| checkFileUploads ()
| 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)
| storeClassAttribute ( $attribute, $version)
| storeDefinedClassAttribute ( $attribute)
| validateClassAttributeHTTPInput ( $http, $base, $classAttribute)
| fixupClassAttributeHTTPInput ( $http, $base, $classAttribute)
| fetchClassAttributeHTTPInput ( $http, $base, $classAttribute)
| title ( $contentObjectAttribute, $name="original_filename")
| hasObjectAttributeContent ( $contentObjectAttribute)
| objectAttributeContent ( $contentObjectAttribute)
| metaData ( $contentObjectAttribute)
| toString ( $objectAttribute)
| fromString ( $objectAttribute, $string)
| serializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| unserializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| serializeContentObjectAttribute ( $package, $objectAttribute)
| unserializeContentObjectAttribute ( $package, $objectAttribute, $attributeNode)
| supportsBatchInitializeObjectAttribute ()
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)
| storeModifiedClassAttribute ( $classAttribute)
| storeVersionedClassAttribute ( $classAttribute, $version)
| preStoreDefinedClassAttribute ( $classAttribute)
| preStoreModifiedClassAttribute ( $classAttribute)
| preStoreVersionedClassAttribute ( $classAttribute, $version)
| 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)
| initializeObjectAttribute ( $objectAttribute, $currentVersion, $originalContentObjectAttribute)
| repairContentObjectAttribute ( $contentObjectAttribute)
| postStore ( $objectAttribute)
| restoreTrashedObjectAttribute ( $objectAttribute)
| 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)
| 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)

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

## Public Attributes
const | DATA_TYPE_STRING = "ezmedia"
const | MAX_FILESIZE_FIELD = 'data_int1'
const | MAX_FILESIZE_VARIABLE = '_ezmedia_max_filesize_'
const | TYPE_FIELD = "data_text1"
const | TYPE_VARIABLE = "_ezmedia_type_"
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 Attributes
| $FileExtensionBlackListValidator

## Detailed Description

The class eZMediaType handles storage and playback of media files.

Definition at line 18 of file ezmediatype.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZMediaType::__construct | ( |  | ) |

Definition at line 26 of file ezmediatype.php.

References ezpI18n\tr().

## Member Function Documentation

## ◆ checkFileUploads()

eZMediaType::checkFileUploads | ( |  | ) |

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

Definition at line 243 of file ezmediatype.php.

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

Referenced by fetchObjectAttributeHTTPInput().

## ◆ customObjectAttributeHTTPAction()

eZMediaType::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 393 of file ezmediatype.php.

References eZMedia\create(), and deleteStoredObjectAttribute().

## ◆ deleteStoredObjectAttribute()

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

Delete stored attribute

Reimplemented from eZDataType.

Definition at line 121 of file ezmediatype.php.

References eZMedia\fetch(), eZMedia\fetchByContentObjectID(), eZClusterFileHandler\instance(), eZSys\instance(), and eZMedia\removeByID().

Referenced by customObjectAttributeHTTPAction().

## ◆ fetchClassAttributeHTTPInput()

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

Fetches the HTTP input for the content class attribute.

Note
  Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 615 of file ezmediatype.php.

## ◆ fetchObjectAttributeHTTPInput()

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

Fetches input and stores it in the data instance.

Reimplemented from eZDataType.

Definition at line 295 of file ezmediatype.php.

References eZHTTPFile\canFetch(), checkFileUploads(), eZMedia\create(), eZHTTPFile\fetch(), eZMedia\fetch(), eZMimeType\findByFileContents(), eZClusterFileHandler\instance(), pluginPage(), eZInputValidator\STATE_ACCEPTED, eZFile\suffix(), validateObjectAttributeHTTPInput(), eZDebug\writeError(), and eZDebug\writeNotice().

## ◆ fixupClassAttributeHTTPInput()

eZMediaType::fixupClassAttributeHTTPInput | ( |  | $http,
|  |  | $base,
|  |  | $classAttribute
| ) |  |

Tries to do a fixup on the input text so that it's acceptable as class attribute input.

Note
  Default implementation does nothing and returns accepted.

Reimplemented from eZDataType.

Definition at line 611 of file ezmediatype.php.

## ◆ fromString()

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

Reimplemented from eZDataType.

Definition at line 691 of file ezmediatype.php.

References insertRegularFile().

## ◆ hasObjectAttributeContent()

eZMediaType::hasObjectAttributeContent | ( |  | $contentObjectAttribute | ) |

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

Reimplemented from eZDataType.

Definition at line 646 of file ezmediatype.php.

References eZMedia\fetch().

## ◆ hasStoredFileInformation()

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

We support file information

Reimplemented from eZDataType.

Definition at line 577 of file ezmediatype.php.

## ◆ insertHTTPFile()

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

Inserts the file using the eZMedia class.

Reimplemented from eZDataType.

Definition at line 424 of file ezmediatype.php.

References eZMedia\create(), eZMedia\fetch(), eZClusterFileHandler\instance(), pluginPage(), and ezpI18n\tr().

## ◆ insertRegularFile()

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

Inserts the file using the eZMedia class.

Reimplemented from eZDataType.

Definition at line 492 of file ezmediatype.php.

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

Referenced by fromString().

## ◆ isHTTPFileInsertionSupported()

eZMediaType::isHTTPFileInsertionSupported | ( |  | ) |

HTTP file insertion is supported.

Reimplemented from eZDataType.

Definition at line 408 of file ezmediatype.php.

## ◆ isRegularFileInsertionSupported()

eZMediaType::isRegularFileInsertionSupported | ( |  | ) |

Regular file insertion is supported.

Reimplemented from eZDataType.

Definition at line 416 of file ezmediatype.php.

## ◆ metaData()

eZMediaType::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 669 of file ezmediatype.php.

## ◆ objectAttributeContent()

eZMediaType::objectAttributeContent | ( |  | $objectAttribute | ) |

Returns the content data for the given content object attribute.

Reimplemented from eZDataType.

Definition at line 657 of file ezmediatype.php.

References eZMedia\fetch().

## ◆ pluginPage()

eZMediaType::pluginPage | ( |  | $mediaType | ) |
| static

Returns plugin page by media type

Definition at line 264 of file ezmediatype.php.

Referenced by fetchObjectAttributeHTTPInput(), insertHTTPFile(), insertRegularFile(), and postInitializeObjectAttribute().

## ◆ postInitializeObjectAttribute()

eZMediaType::postInitializeObjectAttribute | ( |  | $contentObjectAttribute,
|  |  | $currentVersion,
|  |  | $originalContentObjectAttribute
| ) |  |

Sets value according to current version

Reimplemented from eZDataType.

Definition at line 36 of file ezmediatype.php.

References eZMedia\create(), eZMedia\fetch(), and pluginPage().

## ◆ serializeContentClassAttribute()

eZMediaType::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 706 of file ezmediatype.php.

## ◆ serializeContentObjectAttribute()

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

Parameters

  package |
  objectAttribute | content attribute

Returns
  a DOM representation of the content object attribute

Reimplemented from eZDataType.

Definition at line 733 of file ezmediatype.php.

References eZDataType\createContentObjectAttributeDOMNode().

## ◆ storeClassAttribute()

eZMediaType::storeClassAttribute | ( |  | $classAttribute,
|  |  | $version
| ) |  |

Stores the datatype data to the database which is related to the class attribute. The $version parameter determines which version is currently being stored, 0 is the real version while 1 is the temporary version.

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.
  This function is called after the attribute data has been stored. If you need to alter attribute data use preStoreClassAttribute instead.

See also
  fetchClassAttributeHTTPInput

Reimplemented from eZDataType.

Definition at line 598 of file ezmediatype.php.

## ◆ storeDefinedClassAttribute()

eZMediaType::storeDefinedClassAttribute | ( |  | $classAttribute | ) |

Note
  Transaction unsafe. If you call several transaction unsafe methods you must enclose the calls within a db transaction; thus within db->begin and db->commit.

Parameters

  eZContentClassAttribute | $classAttribute | Content class attribute of the datatype

Reimplemented from eZDataType.

Definition at line 602 of file ezmediatype.php.

## ◆ storedFileInformation()

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

Extracts file information for the media entry.

Reimplemented from eZDataType.

Definition at line 586 of file ezmediatype.php.

References eZMedia\fetch().

## ◆ storeObjectAttribute()

eZMediaType::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 389 of file ezmediatype.php.

## ◆ supportsBatchInitializeObjectAttribute()

eZMediaType::supportsBatchInitializeObjectAttribute | ( |  | ) |

Reimplemented from eZDataType.

Definition at line 826 of file ezmediatype.php.

## ◆ title()

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

Returns the object title.

Reimplemented from eZDataType.

Definition at line 634 of file ezmediatype.php.

References eZMedia\fetch().

## ◆ toString()

eZMediaType::toString | ( |  | $objectAttribute | ) |

Returns
  string representation of an contentobjectattribute data for simplified export

Reimplemented from eZDataType.

Definition at line 677 of file ezmediatype.php.

## ◆ trashStoredObjectAttribute()

eZMediaType::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 70 of file ezmediatype.php.

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

## ◆ unserializeContentClassAttribute()

eZMediaType::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 723 of file ezmediatype.php.

## ◆ unserializeContentObjectAttribute()

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

Unserialize contentobject attribute

Parameters

  package |
  objectAttribute | contentobject attribute object
  attributeNode | ezdomnode object

Reimplemented from eZDataType.

Definition at line 772 of file ezmediatype.php.

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

## ◆ validateClassAttributeHTTPInput()

eZMediaType::validateClassAttributeHTTPInput | ( |  | $http,
|  |  | $base,
|  |  | $classAttribute
| ) |  |

Validates the input for a class attribute and returns a validation state as defined in eZInputValidator.

Note
  Default implementation does nothing and returns accepted.

Reimplemented from eZDataType.

Definition at line 606 of file ezmediatype.php.

References eZInputValidator\STATE_ACCEPTED.

## ◆ validateObjectAttributeHTTPInput()

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

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

Reimplemented from eZDataType.

Definition at line 178 of file ezmediatype.php.

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

## Member Data Documentation

## ◆ $FileExtensionBlackListValidator

eZMediaType::$FileExtensionBlackListValidator
| private

The file extension blacklist validator

Definition at line 833 of file ezmediatype.php.

## ◆ DATA_TYPE_STRING

const eZMediaType::DATA_TYPE_STRING = "ezmedia"

Definition at line 20 of file ezmediatype.php.

## ◆ MAX_FILESIZE_FIELD

const eZMediaType::MAX_FILESIZE_FIELD = 'data_int1'

Definition at line 21 of file ezmediatype.php.

## ◆ MAX_FILESIZE_VARIABLE

const eZMediaType::MAX_FILESIZE_VARIABLE = '_ezmedia_max_filesize_'

Definition at line 22 of file ezmediatype.php.

## ◆ TYPE_FIELD

const eZMediaType::TYPE_FIELD = "data_text1"

Definition at line 23 of file ezmediatype.php.

## ◆ TYPE_VARIABLE

const eZMediaType::TYPE_VARIABLE = "_ezmedia_type_"

Definition at line 24 of file ezmediatype.php.

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

- ezmediatype.php

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