Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

The datatype life cycle

When the kernel calls each eZDataType method - class attribute editing, object creation, edit and validation, store and publish, copy and translation, trash and removal, search, sorting, string and package…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/creators/app-creators/datatype-lifecycle.md

On this page

The datatype life cycle

This page is for application creators who write or maintain a datatype. It lists the methods of eZDataType (kernel/classes/ezdatatype.php) by the moment the kernel calls them, so you know which ones your datatype must implement (Writing a custom datatype).

Contents

  1. Class attribute: the field's settings
  2. Object attribute: create and edit
  3. Store and publish
  4. Copies, versions and translations
  5. Trash and removal
  6. Search, sorting and names
  7. Strings and packages
  8. Information collection and the shop

Class attribute: the field's settings

MethodCalled when
initializeClassAttribute()an attribute of the type is added to a class
validateClassAttributeHTTPInput(), fetchClassAttributeHTTPInput()the class edit form is posted
customClassAttributeHTTPAction()a custom button of the class edit form is pressed
preStoreClassAttribute(), storeClassAttribute(), storeDefinedClassAttribute()the class is stored and applied
classAttributeContent()$class_attribute.content is read
isClassAttributeRemovable()before the attribute is removed from the class
deleteStoredClassAttribute()the attribute is removed from the class

Object attribute: create and edit

MethodCalled when
initializeObjectAttribute()a new object or version gets the attribute (copy values from the previous version here)
postInitializeObjectAttribute()after initialization
validateObjectAttributeHTTPInput()the edit form is posted: return eZInputValidator::STATE_ACCEPTED or STATE_INVALID with setValidationError()
fixupObjectAttributeHTTPInput()to correct input before fetching
fetchObjectAttributeHTTPInput()to put the posted value into the attribute; return true when it changed
customObjectAttributeHTTPAction()a custom button of the edit form (upload, remove image ...)
objectAttributeContent(), hasObjectAttributeContent()templates read .content, .has_content

Store and publish

MethodCalled when
storeObjectAttribute()the attribute is stored (every save of the draft)
postStore()after storing
onPublish()the version is published: the moment for work that must only happen for published data

Copies, versions and translations

initializeObjectAttribute( $objectAttribute, $currentVersion, $originalContentObjectAttribute ) is also called for a new version, a copy and a new translation: copy what the original holds, including data in your own tables. isTranslatable() (a datatype property) decides whether each language has its own value.

Trash and removal

MethodCalled when
trashStoredObjectAttribute()the object goes to the trash
restoreTrashedObjectAttribute()it is restored
deleteStoredObjectAttribute( $objectAttribute, $version = null )a version or the whole object is removed: delete your own rows and files here

Search, sorting and names

MethodPurpose
isIndexable(), metaData()whether and what text goes into the search index
sortKey(), sortKeyType()the value and type (int or string) used to sort by the attribute
title()the attribute's part of the object name pattern
isRelationType(), removeRelatedObjectItem(), fixRelatedObjectItem()relation datatypes
diff()the version comparison view

Strings and packages

MethodPurpose
toString(), fromString()a plain string form, used by imports, CSV, REST and eZContentFunctions
serializeContentClassAttribute(), unserializeContentClassAttribute()the attribute's settings in packages
serializeContentObjectAttribute(), unserializeContentObjectAttribute(), postUnserializeContentObjectAttribute()values in content packages
isSimpleStringInsertionSupported(), insertSimpleString(), insertHTTPFile(), insertRegularFile()uploads and WebDAV

Make fromString( toString( x ) ) give x back; test it.

Information collection and the shop

MethodPurpose
isInformationCollector(), hasInformationCollection()the attribute can be filled in by visitors
validateCollectionAttributeHTTPInput(), fetchCollectionAttributeHTTPInput()the visitor's form value
isAddToBasketValidationRequired(), validateAddToBasket(), productOptionInformation()product options

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x