eZ Publish  [4.2]
eZDataType Class Reference

Base class for content datatypes. More...

+ Inheritance diagram for eZDataType:

List of all members.

Public Member Functions

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

Static Public Member Functions

static allowedTypes ()
static create ($dataTypeString)
static loadAndRegisterAllTypes ()
static loadAndRegisterType ($type)
static register ($dataTypeString, $className)
static registeredDataTypes ()

Public Attributes

 $DataTypeString
 The datatype string ID, used for uniquely identifying a datatype.
 $Name
 The descriptive name of the datatype, usually used for displaying to the user.

Private Member Functions

 cleanDBDataBeforeImport ()

Detailed Description

Base class for content datatypes.

Defines both the interface for datatypes as well as functions for registering, quering and fetching datatypes.

Each new datatype will inherit this class and define some functions as well as three templates. A datatype has three roles, it handles definition of content class attributes, editing of a content object attribute and viewing of a content object attribute. The content class attribute definition part is optional while object attribute edit and view must be implemented for the datatype to be usable.

If the datatype handles class attribute definition it must define one or more of these functions: storeClassAttribute, validateClassAttributeHTTPInput, fixupClassAttributeHTTPInput, fetchClassAttributeHTTPInput. See each function for more details. The class attribute definition usually defines the default data and/or the validation rules for an object attribute.

Object attribute editing must define these functions: storeObjectAttribute, validateObjectAttributeHTTPInput, fixupObjectAttributeHTTPInput, fetchObjectAttributeHTTPInput, initializeObjectAttribute. If the attribute wants to have a custom action it must implement the customObjectAttributeHTTPAction function. See each function for more details.

Each datatype initializes itself with a datatype string id (ezstring, ezinteger) and a descriptive name. The datatype string id must be unique for the whole system and should have a prefix, for instance we in eZ Systems use ez as our prefix.

Definition at line 65 of file ezdatatype.php.


Member Function Documentation

static eZDataType::allowedTypes ( ) [static]

Definition at line 1179 of file ezdatatype.php.

Referenced by loadAndRegisterAllTypes().

eZDataType::attribute ( attr)
Returns:
the data for the attribute $attr or null if it does not exist.

Definition at line 244 of file ezdatatype.php.

eZDataType::attributes ( )
Returns:
the attributes for this datatype.

Definition at line 228 of file ezdatatype.php.

eZDataType::batchInitializeObjectAttributeData ( classAttribute)
eZDataType::classAttributeContent ( classAttribute)

Returns the content data for the given content class attribute.

Reimplemented in eZObjectRelationListType, eZObjectRelationType, eZMatrixType, eZISBNType, eZCountryType, eZDateTimeType, eZEnumType, eZSelectionType, eZMultiPriceType, and eZPriceType.

Definition at line 608 of file ezdatatype.php.

eZDataType::classAttributeRemovableInformation ( classAttribute,
includeAll = true 
)

If the call to isClassAttributeRemovable() returns false then this can be called to figure out why it cannot be removed, e.g to give information to the user.

Returns:
An array structure with information, or false if no info is available
  • text - Plain text explaining why it can't be removed
  • list - A list of reasons with details on why it can be removed
    • identifier - The identifier of the reason (optional)
    • text - Plain text explaning the reason
Parameters:
$includeAllControls whether the returned information will contain all sources for not being to remove or just the first that it finds.

Reimplemented in eZUserType.

Definition at line 978 of file ezdatatype.php.

Referenced by isClassAttributeRemovable().

eZDataType::classDisplayInformation ( classAttribute,
mergeInfo = false 
)

Will return information on how the datatype should be represented in the various display modes when used by a class.

If this method is reimplemented the implementor must call this method with the new info array as second parameter.

Parameters:
$classAttributeThe content class attribute to return info for.
$mergeInfoA structure that must match the returned array, or false to ignore. Any entries here will override the default.
Returns:
An array structure which contains:
  • edit
    • grouped_input - If true then the datatype has lots of input elements that should be grouped. (e.g. in a fieldset) ClassEditSettings/GroupedInput in datatype.ini is used to automatically determine this field and will override the default and datatype setting if used.
  • view

Definition at line 553 of file ezdatatype.php.

eZDataType::cleanDBDataBeforeImport ( ) [private]

Used by updateDBDataByDBAFile() method Must return true if successfull, or false otherwise.

Reimplemented in eZISBNType.

Definition at line 1401 of file ezdatatype.php.

Referenced by importDBDataFromDBAFile().

eZDataType::cloneClassAttribute ( oldClassAttribute,
newClassAttribute 
)

Clones the date from the old class attribute to the new one.

Note:
Default implementation does nothing which is good enough for datatypes which does not use external tables.

Reimplemented in eZEnumType.

Definition at line 822 of file ezdatatype.php.

eZDataType::contentActionList ( classAttribute)
Returns:
the content action(s) which can be performed on object containing the current datatype.

Reimplemented in eZMultiPriceType, eZPriceType, and eZKeywordType.

Definition at line 886 of file ezdatatype.php.

eZDataType::customClassAttributeHTTPAction ( http,
action,
classAttribute 
)

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

Note:
Default implementation does nothing.

Reimplemented in eZObjectRelationListType, eZObjectRelationType, eZIdentifierType, eZMatrixType, eZEnumType, and eZISBNType.

Definition at line 714 of file ezdatatype.php.

eZDataType::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 in eZObjectRelationListType, eZXMLTextType, eZImageType, eZMediaType, eZBinaryFileType, eZObjectRelationType, eZMultiOption2Type, eZMultiOptionType, eZMultiPriceType, eZAuthorType, eZOptionType, and eZMatrixType.

Definition at line 795 of file ezdatatype.php.

eZDataType::customSorting ( )

Reimplemented in eZMultiPriceType.

Definition at line 1008 of file ezdatatype.php.

eZDataType::customSortingSQL ( params)

Reimplemented in eZMultiPriceType.

Definition at line 1013 of file ezdatatype.php.

eZDataType::deleteStoredClassAttribute ( classAttribute,
version = null 
)

Clean up stored class attribute

Note:
Default implementation does nothing.

Reimplemented in eZEnumType.

Definition at line 878 of file ezdatatype.php.

eZDataType::deleteStoredObjectAttribute ( objectAttribute,
version = null 
)

Clean up stored object attribute

Note:
Default implementation does nothing.

Reimplemented in eZObjectRelationListType, eZXMLTextType, eZMultiPriceType, eZKeywordType, eZBinaryFileType, eZMediaType, eZEnumType, eZImageType, eZURLType, and eZUserType.

Definition at line 870 of file ezdatatype.php.

eZDataType::diff ( old,
new,
options = false 
)

Method used by content diff system to retrieve changes in attributes. This method implements the default behaviour, which is to show old and new version values of the object.

Reimplemented in eZXMLTextType, eZIniSettingType, eZEnumType, eZMultiPriceType, eZCountryType, eZStringType, eZTextType, eZPackageType, eZProductCategoryType, and eZSubtreeSubscriptionType.

Definition at line 1293 of file ezdatatype.php.

eZDataType::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 in eZMultiOption2Type, eZXMLTextType, and eZBinaryFileType.

Definition at line 118 of file ezdatatype.php.

eZDataType::fetchActionValue ( action,
actionName,
&$  value 
)

Matches the action against the action name $actionName and extracts the value from the action puts it into $value.

Returns:
true if the action matched and a value was found, false otherwise. If no match is made or no value found the $value parameter is not modified.

Definition at line 725 of file ezdatatype.php.

Referenced by eZObjectRelationListType\customObjectAttributeHTTPAction().

eZDataType::fetchClassAttributeHTTPInput ( http,
base,
classAttribute 
)
eZDataType::fetchCollectionAttributeHTTPInput ( collection,
collectionAttribute,
http,
base,
objectAttribute 
)

Fetches the HTTP collected information for the content object attribute.

Note:
Default implementation does nothing.
Returns:
true if variable was successfully fetched.

Reimplemented in eZCountryType, eZDateTimeType, eZIntegerType, eZSelectionType, eZMultiOptionType, eZOptionType, eZStringType, eZDateType, eZTimeType, eZEmailType, eZTextType, eZBooleanType, and eZProductCategoryType.

Definition at line 787 of file ezdatatype.php.

eZDataType::fixRelatedObjectItem ( contentObjectAttribute,
objectID,
mode 
)

Fixes objects with given ID in the relations list according to what is done with object

Note:
Default implementation does nothing.

Reimplemented in eZObjectRelationListType.

Definition at line 1263 of file ezdatatype.php.

eZDataType::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 in eZMediaType, eZObjectRelationListType, eZIntegerType, eZFloatType, eZStringType, eZObjectRelationType, and eZKeywordType.

Definition at line 697 of file ezdatatype.php.

eZDataType::fixupCollectionAttributeHTTPInput ( http,
base,
objectAttribute 
)

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

Note:
Default implementation does nothing.

Definition at line 777 of file ezdatatype.php.

eZDataType::fixupObjectAttributeHTTPInput ( http,
base,
objectAttribute 
)

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

Note:
Default implementation does nothing.

Reimplemented in eZFloatType, eZIntegerType, and eZObjectRelationListType.

Definition at line 750 of file ezdatatype.php.

eZDataType::getDBAExtensionFilePath ( )

Returns dba-data file extension path (relative to the system root folder) for the specific datatype.

Returns:
the first path that is found for the datatype. If not found, it will return false.

Definition at line 1328 of file ezdatatype.php.

Referenced by getDBAFilePath().

eZDataType::getDBAFileName ( )

Returns dba-data file name of the specific datatype. This one is the default dba-data file name for all datatypes

Definition at line 1306 of file ezdatatype.php.

Referenced by getDBAExtensionFilePath(), and getDBAFilePath().

eZDataType::getDBAFilePath ( checkExtensions = true)

Returns dba-data file path (relative to the system root folder) for the specific datatype.

Definition at line 1314 of file ezdatatype.php.

Referenced by importDBDataFromDBAFile().

eZDataType::handleCustomObjectHTTPActions ( http,
attributeDataBaseName,
customActionAttributeArray,
customActionParameters 
)

Takes care of custom action handling, this means checking if a custom action request must be sent to a contentobject attribute. This function is only useful for datatypes that must do custom action handling for sub objects and attributes.

Note:
Default implementation does nothing.

Reimplemented in eZObjectRelationListType.

Definition at line 805 of file ezdatatype.php.

eZDataType::handleDownload ( object,
objectVersion,
objectLanguage,
objectAttribute 
)

This function is called when someone tries to download the file.

Parameters:
$objectThe contentobject in which the attribute is contained
$objectVersionThe current version of the object it is being worked on
$objectLanguageThe current language being worked on
$objectAttributeThe attribute which stored the file
Returns:
true if any action has been don or false if hasn't.

Reimplemented in eZBinaryFileType.

Definition at line 400 of file ezdatatype.php.

eZDataType::hasAttribute ( attr)
Returns:
true if the attribute $attr exists in this object.

Definition at line 236 of file ezdatatype.php.

eZDataType::hasInformationCollection ( )
Returns:
true if the data type can do information collection

Definition at line 907 of file ezdatatype.php.

eZDataType::hasStoredFileInformation ( object,
objectVersion,
objectLanguage,
objectAttribute 
)

Checks if the datatype supports returning file information.

Parameters:
$objectThe contentobject in which the attribute is contained
$objectVersionThe current version of the object it is being worked on
$objectLanguageThe current language being worked on
$objectAttributeThe attribute which stored the file
Returns:
true if file information is supported or false if it doesn't.

Reimplemented in eZMediaType, eZBinaryFileType, and eZImageType.

Definition at line 383 of file ezdatatype.php.

eZDataType::importDBDataFromDBAFile ( dbaFilePath = false)

Used by setup-wizard to update database data using per datatype dba file which is usually placed in share subfolder of the datatype and (share/db_data.dba) Any reimplementation of this method must return true if import is succesfully done, otherwise false.

Definition at line 1353 of file ezdatatype.php.

Referenced by eZISBNType\customClassAttributeHTTPAction().

eZDataType::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 in eZXMLTextType, and eZBinaryFileType.

Definition at line 131 of file ezdatatype.php.

eZDataType::initializeClassAttribute ( classAttribute)

Initializes the class attribute with some data.

Note:
Default implementation does nothing.

Reimplemented in eZObjectRelationListType, eZISBNType, eZDateTimeType, eZTimeType, eZDateType, eZIniSettingType, eZXMLTextType, eZPriceType, eZIdentifierType, eZEnumType, eZMultiPriceType, and eZTextType.

Definition at line 814 of file ezdatatype.php.

eZDataType::initializeObjectAttribute ( objectAttribute,
currentVersion,
originalContentObjectAttribute 
)
eZDataType::insertHTTPFile ( object,
objectVersion,
objectLanguage,
objectAttribute,
httpFile,
mimeData,
&$  result 
)

Inserts the HTTP file $httpFile to the content object attribute $objectAttribute.

Parameters:
$objectThe contentobject in which the attribute is contained
$objectVersionThe current version of the object it is being worked on
$objectLanguageThe current language being worked on
$objectAttributeThe attribute which will get the file
$httpFileObject of type eZHTTPFile which contains information on the uploaded file
$mimeDataMIME-Type information on the file, can be used to figure out a storage name
[out]$resultArray which will be filled with information on the process, it will contain:
  • errors - Array with error elements, each element is an array with 'description' containing the text
  • require_storage - true if the attribute must be stored after this call, or false if not required at all
Returns:
true if the file was stored correctly in the attribute or false if something failed.
Note:
The datatype will return null (the default) if does not support HTTP files.
$result will not be defined if the return value is null
The $httpFile must not be stored prior to calling this, the datatype will handle this internally
See also:
isHTTPFileInsertionSupported()

Reimplemented in eZMediaType, eZBinaryFileType, and eZImageType.

Definition at line 307 of file ezdatatype.php.

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

Inserts the file named $filePath to the content object attribute $objectAttribute.

Parameters:
$objectThe contentobject in which the attribute is contained
$objectVersionThe current version of the object it is being worked on
$objectLanguageThe current language being worked on
$objectAttributeThe attribute which will get the file
$filePathFull path including the filename
[out]$resultArray which will be filled with information on the process, it will contain:
  • errors - Array with error elements, each element is an array with 'description' containing the text
  • require_storage - true if the attribute must be stored after this call, or false if not required at all
Returns:
true if the file was stored correctly in the attribute or false if something failed.
Note:
The datatype will return null (the default) if does not support HTTP files.
$result will not be defined if the return value is null
See also:
isRegularFileInsertionSupported()

Reimplemented in eZMediaType, eZBinaryFileType, and eZImageType.

Definition at line 335 of file ezdatatype.php.

eZDataType::insertSimpleString ( object,
objectVersion,
objectLanguage,
objectAttribute,
string,
&$  result 
)

Inserts the string $string to the content object attribute $objectAttribute.

Parameters:
$objectThe contentobject in which the attribute is contained
$objectVersionThe current version of the object it is being worked on
$objectLanguageThe current language being worked on
$objectAttributeThe attribute which will get the file
$filePathFull path including the filename
[out]$resultArray which will be filled with information on the process, it will contain:
  • errors - Array with error elements, each element is an array with 'description' containing the text
  • require_storage - true if the attribute must be stored after this call, or false if not required at all
Returns:
true if the file was stored correctly in the attribute or false if something failed.
Note:
The datatype will return null (the default) if does not support HTTP files.
$result will not be defined if the return value is null
See also:
isSimpleStringInsertionSupported()

Reimplemented in eZCountryType, eZStringType, and eZTextType.

Definition at line 363 of file ezdatatype.php.

eZDataType::isA ( )
Returns:
the data type identification string.

Definition at line 220 of file ezdatatype.php.

Referenced by createContentObjectAttributeDOMNode(), and serializeContentObjectAttribute().

eZDataType::isAddToBasketValidationRequired ( )
Returns:
true if the datatype requires validation during add to basket procedure

Reimplemented in eZMultiOption2Type.

Definition at line 932 of file ezdatatype.php.

eZDataType::isClassAttributeRemovable ( classAttribute)

Queries the datatype if the attribute containing this datatype can be removed from the class. This can be used by datatypes to ensure that very important datatypes that could cause system malfunction is not removed. The datatype will only need to reimplemented this if it wants to do some checking, the default returns true.

Returns:
true if the class attribute can be removed or false.
See also:
classAttributeRemovableInformation()
Note:
The default code will call classAttributeRemovableInformation with $includeAll set to false, if it returns false or an empty 'list' it will return true.

Definition at line 960 of file ezdatatype.php.

eZDataType::isHTTPFileInsertionSupported ( )
Returns:
true if the datatype support insertion of HTTP files or false (default) otherwise.
See also:
insertHTTPFile()

Reimplemented in eZMediaType, eZBinaryFileType, and eZImageType.

Definition at line 261 of file ezdatatype.php.

eZDataType::isInformationCollector ( )
Returns:
true if the datatype can be used as an information collector

Reimplemented in eZXMLTextType, eZOptionType, eZCountryType, eZIntegerType, eZSelectionType, eZStringType, eZDateTimeType, eZTimeType, eZDateType, eZTextType, eZEmailType, eZBooleanType, and eZProductCategoryType.

Definition at line 986 of file ezdatatype.php.

Referenced by eZDataType().

eZDataType::isRegularFileInsertionSupported ( )
Returns:
true if the datatype support insertion of files or false (default) otherwise.
See also:
insertRegularFile()

Reimplemented in eZMediaType, eZBinaryFileType, and eZImageType.

Definition at line 271 of file ezdatatype.php.

eZDataType::isSimpleStringInsertionSupported ( )
Returns:
true if the datatype support insertion of simple strings or false (default) otherwise.
See also:
insertSimpleString()

Reimplemented in eZCountryType, eZStringType, and eZTextType.

Definition at line 281 of file ezdatatype.php.

static eZDataType::loadAndRegisterAllTypes ( ) [static]

Definition at line 1191 of file ezdatatype.php.

static eZDataType::loadAndRegisterType ( type) [static]

Definition at line 1200 of file ezdatatype.php.

Referenced by create(), eZUser\isUserObject(), and loadAndRegisterAllTypes().

eZDataType::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 in eZObjectRelationListType, eZMediaType, eZBinaryFileType, eZImageType, eZObjectRelationType, eZIntegerType, eZISBNType, eZEnumType, eZCountryType, eZXMLTextType, eZUserType, eZTimeType, eZFloatType, eZSelectionType, eZDateTimeType, eZStringType, eZDateType, eZURLType, eZIdentifierType, eZTextType, eZEmailType, eZRangeOptionType, eZPackageType, eZBooleanType, eZAuthorType, eZMultiOptionType, eZKeywordType, eZOptionType, eZMatrixType, eZProductCategoryType, eZPriceType, and eZMultiOption2Type.

Definition at line 1023 of file ezdatatype.php.

eZDataType::objectDisplayInformation ( objectAttribute,
mergeInfo = false 
)

Will return information on how the datatype should be represented in the various display modes when used by an object.

If this method is reimplemented the implementor must call this method with the new info array as second parameter.

Parameters:
$objectAttributeThe content object attribute to return info for.
$mergeInfoA structure that must match the returned array, or false to ignore. Any entries here will override the default.
Returns:
An array structure which contains:
  • edit
    • grouped_input - If true then the datatype has lots of input elements that should be grouped. (e.g. in a fieldset) EditSettings/GroupedInput in datatype.ini is used to automatically determine this field
  • view
  • collection
    • grouped_input - If true then the datatype has lots of input elements that should be grouped. (e.g. in a fieldset) CollectionSettings/GroupedInput in datatype.ini is used to automatically determine this field and will override the default and datatype setting if used.
  • result

Reimplemented in eZEnumType, and eZObjectRelationType.

Definition at line 486 of file ezdatatype.php.

eZDataType::onPublish ( contentObjectAttribute,
contentObject,
publishedNodes 
)

Performs necessary actions with attribute data after object is published, it means that you have access to published nodes.

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.
Might be transaction unsafe.

Reimplemented in eZObjectRelationListType, eZImageType, eZIniSettingType, eZIdentifierType, eZXMLTextType, and eZSubtreeSubscriptionType.

Definition at line 636 of file ezdatatype.php.

eZDataType::postInitializeObjectAttribute ( objectAttribute,
currentVersion,
originalContentObjectAttribute 
)

Initializes the object attribute with some data after object attribute is already stored. It means that for initial version you allready have an attribute_id and you can store data somewhere using this id.

Note:
Default implementation does nothing.

Reimplemented in eZXMLTextType, eZMultiPriceType, and eZMediaType.

Definition at line 847 of file ezdatatype.php.

eZDataType::postStore ( objectAttribute)

Reimplemented in eZURLType.

Definition at line 854 of file ezdatatype.php.

eZDataType::postUnserializeContentObjectAttribute ( package,
objectAttribute 
)

Reimplemented in eZObjectRelationListType, eZXMLTextType, and eZObjectRelationType.

Definition at line 1174 of file ezdatatype.php.

eZDataType::preStoreClassAttribute ( classAttribute,
version 
)

Similar to the storeClassAttribute but is called before the attribute itself is stored and can be used to set values in the class attribute.

Returns:
True if the value was stored correctly.
See also:
fetchClassAttributeHTTPInput

Reimplemented in eZObjectRelationListType, eZIdentifierType, eZMatrixType, eZISBNType, eZObjectRelationType, and eZCountryType.

Definition at line 647 of file ezdatatype.php.

Referenced by preStoreDefinedClassAttribute().

eZDataType::preStoreDefinedClassAttribute ( classAttribute)

Reimplemented in eZIdentifierType.

Definition at line 677 of file ezdatatype.php.

eZDataType::productOptionInformation ( objectAttribute,
optionID,
productItem 
)

Fetches the product option information for option with ID $optionID and returns this information. This will be called from the basket when a new product with an option is added, it is then up to the specific datatype to return proper data. It will also be used to recalcuate prices.

Parameters:
$objectAttributeThe attribute that the datatype controls.
$optionIDThe ID of the option which information should be returned from.
$productItemThe product item object which contains the option, is available for reading only.
Returns:
An array structure which contains:
  • id - The unique ID of the selected option, this must be unique in the attribute and will later on be used to recalculate prices.
  • name - The name of the option list
  • value - The display string of the selected option
  • additional_price - A value which is added to the total product price, set to 0 or false if no price is used. If the option could not be found it should return false, if not supported it should return null.
See also:
handleProductOption

Reimplemented in eZMultiOption2Type, eZMultiOptionType, eZOptionType, and eZRangeOptionType.

Definition at line 451 of file ezdatatype.php.

static eZDataType::register ( dataTypeString,
className 
) [static]

Registers the datatype with string id $dataTypeString and class name $className. The class name is used for instantiating the class and should be in lowercase letters.

Definition at line 209 of file ezdatatype.php.

static eZDataType::registeredDataTypes ( ) [static]
Returns:
a list of datatypes which has been registered.
Note:
This will instantiate all datatypes.

Definition at line 183 of file ezdatatype.php.

eZDataType::removeRelatedObjectItem ( contentObjectAttribute,
objectID 
)

Removes objects with given ID from the relations list

Note:
Default implementation does nothing.

Reimplemented in eZObjectRelationListType, and eZObjectRelationType.

Definition at line 1255 of file ezdatatype.php.

eZDataType::repairContentObjectAttribute ( contentObjectAttribute)

Tries to do a repair on the content object attribute $contentObjectAttribute and returns true if it succeeds.

Returns:
false if it fails or null if it is not supported to do a repair.

Definition at line 838 of file ezdatatype.php.

eZDataType::resultTemplate ( &$  collectionAttribute)
Returns:
the template name to use for result view of an information collection 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.
$collectionAttribute can in some cases be a eZContentObjectAttribute, so any datatype that overrides this must be able to handle both types.

Definition at line 145 of file ezdatatype.php.

eZDataType::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 in eZObjectRelationListType, eZMediaType, eZMultiOption2Type, eZBinaryFileType, eZObjectRelationType, eZXMLTextType, eZDateTimeType, eZEnumType, eZImageType, eZMatrixType, eZIntegerType, eZIniSettingType, eZMultiOptionType, eZSelectionType, eZIdentifierType, eZOptionType, eZMultiPriceType, eZFloatType, eZTimeType, eZStringType, eZDateType, eZPriceType, eZTextType, eZRangeOptionType, eZBooleanType, and eZPackageType.

Definition at line 1060 of file ezdatatype.php.

eZDataType::serializeContentObjectAttribute ( package,
objectAttribute 
)
eZDataType::sortKey ( objectAttribute)
Returns:
the sort key for the datatype. This is used for sorting on attribute level.

Reimplemented in eZDateTimeType, eZIntegerType, eZCountryType, eZSelectionType, eZObjectRelationType, eZIdentifierType, eZStringType, eZDateType, eZEmailType, eZTimeType, eZPackageType, eZPriceType, eZBooleanType, and eZProductCategoryType.

Definition at line 994 of file ezdatatype.php.

eZDataType::sortKeyType ( )
Returns:
the type of the sort key int|string False is returned if sorting is not supported

Reimplemented in eZDateTimeType, eZCountryType, eZIntegerType, eZSelectionType, eZObjectRelationType, eZIdentifierType, eZStringType, eZDateType, eZEmailType, eZTimeType, eZPackageType, eZPriceType, eZBooleanType, and eZProductCategoryType.

Definition at line 1003 of file ezdatatype.php.

eZDataType::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 in eZMediaType, eZFloatType, eZEnumType, eZIntegerType, eZStringType, eZURLType, eZKeywordType, and eZMatrixType.

Definition at line 664 of file ezdatatype.php.

eZDataType::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.

Reimplemented in eZMediaType, eZEnumType, eZStringType, eZURLType, and eZKeywordType.

Definition at line 673 of file ezdatatype.php.

eZDataType::storedFileInformation ( object,
objectVersion,
objectLanguage,
objectAttribute 
)

Returns file information for the filed stored by the attribute.

Parameters:
$objectThe contentobject in which the attribute is contained
$objectVersionThe current version of the object it is being worked on
$objectLanguageThe current language being worked on
$objectAttributeThe attribute which stored the file
Returns:
An array structure with information or false (default) if no information could be found. The structure must contain:
  • filepath - The full path to the file

The structure can contain:

  • filename - The name of the file, if not supplied it will be figured out from the filepath
  • filesize - The size of the file, if not supplied it will be figured out from the filepath
  • mime_type - The MIME type for the file, if not supplied it will be figured out from the filepath

Reimplemented in eZMediaType, eZBinaryFileType, and eZImageType.

Definition at line 428 of file ezdatatype.php.

eZDataType::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 in eZMediaType, eZBinaryFileType, eZObjectRelationListType, eZISBNType, eZCountryType, eZXMLTextType, eZIntegerType, eZImageType, eZUserType, eZEnumType, eZStringType, eZURLType, eZFloatType, eZEmailType, eZObjectRelationType, eZTextType, eZMultiOptionType, eZOptionType, eZRangeOptionType, eZAuthorType, eZKeywordType, eZPackageType, eZMultiPriceType, eZPriceType, eZIdentifierType, eZMatrixType, eZMultiOption2Type, and eZBooleanType.

Definition at line 622 of file ezdatatype.php.

eZDataType::templateList ( )

Can be called to figure out if a datatype has certain special templates that it relies on. This can for instance be used to figure out which override templates to include in a package.

Returns:
An array with template files that this datatype relies on. Each element can be one of the following types:
  • string - The filepath of the template
  • array - Advanced matching criteria, element 0 determines the type:
    • 'regexp' - A regular expression, element 1 is the regexp string (PREG) If false is returned it means there are no relations to any templates.
Note:
All matching is done relative from templates directory in the given design.
The templates that are found in content/datatype/* should not be included.

Reimplemented in eZXMLTextType.

Definition at line 1050 of file ezdatatype.php.

eZDataType::trashStoredObjectAttribute ( objectAttribute,
version = null 
)

Do any necessary changes to stored object attribute when moving an object to trash.

Note:
Default implementation does nothing.

Reimplemented in eZBinaryFileType, eZMediaType, and eZImageType.

Definition at line 862 of file ezdatatype.php.

eZDataType::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 in eZObjectRelationListType, eZMediaType, eZMultiOption2Type, eZBinaryFileType, eZObjectRelationType, eZDateTimeType, eZXMLTextType, eZEnumType, eZMatrixType, eZImageType, eZIntegerType, eZIniSettingType, eZMultiOptionType, eZSelectionType, eZIdentifierType, eZMultiPriceType, eZOptionType, eZFloatType, eZTimeType, eZStringType, eZDateType, eZPriceType, eZTextType, eZRangeOptionType, eZBooleanType, and eZPackageType.

Definition at line 1071 of file ezdatatype.php.

eZDataType::unserializeContentObjectAttribute ( package,
objectAttribute,
attributeNode 
)

Unserialize contentobject attribute

Parameters:
package
objectAttributecontentobject attribute object
attributeNodeezdomnode object

Reimplemented in eZObjectRelationListType, eZMediaType, eZBinaryFileType, eZMultiOption2Type, eZIniSettingType, eZXMLTextType, eZDateTimeType, eZObjectRelationType, eZMatrixType, eZImageType, eZUserType, eZMultiOptionType, eZMultiPriceType, eZEnumType, eZTimeType, eZOptionType, eZDateType, eZURLType, eZAuthorType, eZKeywordType, eZRangeOptionType, and eZSubtreeSubscriptionType.

Definition at line 1134 of file ezdatatype.php.

eZDataType::validateAddToBasket ( objectAttribute,
data,
&$  errors 
)

Validates the input for an object attribute during add to basket process and returns a validation state as defined in eZInputValidator.

Note:
Default implementation does nothing and returns accepted.

Reimplemented in eZMultiOption2Type.

Definition at line 941 of file ezdatatype.php.

eZDataType::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 in eZMediaType, eZObjectRelationListType, eZIntegerType, eZEnumType, eZFloatType, eZStringType, eZURLType, eZObjectRelationType, eZKeywordType, eZIdentifierType, eZIniSettingType, and eZSelectionType.

Definition at line 687 of file ezdatatype.php.

eZDataType::validateCollectionAttributeHTTPInput ( http,
base,
objectAttribute 
)

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

Note:
Default implementation does nothing and returns accepted.

Reimplemented in eZCountryType, eZIntegerType, eZSelectionType, eZDateTimeType, eZDateType, eZStringType, eZTimeType, eZEmailType, eZTextType, eZBooleanType, and eZOptionType.

Definition at line 767 of file ezdatatype.php.

eZDataType::validateObjectAttributeHTTPInput ( http,
base,
objectAttribute 
)
eZDataType::viewTemplate ( contentobjectAttribute)
Returns:
the template name to use for viewing 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:
editTemplate, informationTemplate

Reimplemented in eZXMLTextType, and eZBinaryFileType.

Definition at line 105 of file ezdatatype.php.


Member Data Documentation

eZDataType::$DataTypeString

The datatype string ID, used for uniquely identifying a datatype.

Definition at line 1418 of file ezdatatype.php.

eZDataType::$Name

The descriptive name of the datatype, usually used for displaying to the user.

Definition at line 1420 of file ezdatatype.php.


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