Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

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

A content datatype which handles object relations. More...

Inheritance diagram for eZObjectRelationType:

## Public Member Functions
| __construct ()
| isRelationType ()
| initializeObjectAttribute ( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
| validateObjectAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| fetchObjectAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| storeClassAttributeContent ( $classAttribute, $content)
| validateClassAttributeHTTPInput ( $http, $base, $classAttribute)
| fixupClassAttributeHTTPInput ( $http, $base, $classAttribute)
| fetchClassAttributeHTTPInput ( $http, $base, $classAttribute)
| initializeClassAttribute ( $classAttribute)
| preStoreClassAttribute ( $classAttribute, $version)
| customObjectAttributeHTTPAction ( $http, $action, $contentObjectAttribute, $parameters)
| objectAttributeContent ( $contentObjectAttribute)
| defaultClassAttributeContent ()
| objectDisplayInformation ( $objectAttribute, $mergeInfo=false)
| sortKey ( $contentObjectAttribute)
| sortKeyType ()
| classAttributeContent ( $classObjectAttribute)
| deleteNotVersionedStoredClassAttribute (eZContentClassAttribute $classAttribute)
| createClassContentStructure ( $doc)
| customClassAttributeHTTPAction ( $http, $action, $classAttribute)
| metaData ( $contentObjectAttribute)
| toString ( $contentObjectAttribute)
| fromString ( $contentObjectAttribute, $string)
| isIndexable ()
| title ( $contentObjectAttribute, $name=null)
| hasObjectAttributeContent ( $contentObjectAttribute)
| serializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| unserializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| serializeContentObjectAttribute ( $package, $objectAttribute)
| unserializeContentObjectAttribute ( $package, $objectAttribute, $attributeNode)
| postUnserializeContentObjectAttribute ( $package, $objectAttribute)
| removeRelatedObjectItem ( $contentObjectAttribute, $objectID)
| 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)
| isHTTPFileInsertionSupported ()
| isRegularFileInsertionSupported ()
| isSimpleStringInsertionSupported ()
| insertHTTPFile ( $object, $objectVersion, $objectLanguage, $objectAttribute, $httpFile, $mimeData, &$result)
| insertRegularFile ( $object, $objectVersion, $objectLanguage, $objectAttribute, $filePath, &$result)
| insertSimpleString ( $object, $objectVersion, $objectLanguage, $objectAttribute, $string, &$result)
| hasStoredFileInformation ( $object, $objectVersion, $objectLanguage, $objectAttribute)
| handleDownload ( $object, $objectVersion, $objectLanguage, $objectAttribute)
| storedFileInformation ( $object, $objectVersion, $objectLanguage, $objectAttribute)
| productOptionInformation ( $objectAttribute, $optionID, $productItem)
| classDisplayInformation ( $classAttribute, $mergeInfo=false)
| storeObjectAttribute ( $objectAttribute)
| onPublish ( $contentObjectAttribute, $contentObject, $publishedNodes)
| storeClassAttribute ( $classAttribute, $version)
| storeDefinedClassAttribute ( $classAttribute)
| storeModifiedClassAttribute ( $classAttribute)
| storeVersionedClassAttribute ( $classAttribute, $version)
| preStoreDefinedClassAttribute ( $classAttribute)
| preStoreModifiedClassAttribute ( $classAttribute)
| preStoreVersionedClassAttribute ( $classAttribute, $version)
| 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)
| cloneClassAttribute ( $oldClassAttribute, $newClassAttribute)
| repairContentObjectAttribute ( $contentObjectAttribute)
| postInitializeObjectAttribute ( $objectAttribute, $currentVersion, $originalContentObjectAttribute)
| postStore ( $objectAttribute)
| trashStoredObjectAttribute ( $objectAttribute, $version=null)
| restoreTrashedObjectAttribute ( $objectAttribute)
| deleteStoredObjectAttribute ( $objectAttribute, $version=null)
| deleteStoredClassAttribute ( $classAttribute, $version=null)
| contentActionList ( $classAttribute)
| hasInformationCollection ()
| isAddToBasketValidationRequired ()
| validateAddToBasket ( $objectAttribute, $data, &$errors)
| isClassAttributeRemovable ( $classAttribute)
| classAttributeRemovableInformation ( $classAttribute, $includeAll=true)
| isInformationCollector ()
| customSorting ()
| customSortingSQL ( $params)
| templateList ()
| 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
static | storeClassDOMDocument ( $doc, $classAttribute)
static | storeObjectDOMDocument ( $doc, $objectAttribute)
static | domString ( $domDocument)
static | createClassDOMDocument ( $content)
static | parseXML ( $xmlText)
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 = "ezobjectrelation"
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
| fuzzyTextMatch ( $text, $match)
| removeContentObjectRelation ( $contentObjectAttribute)

## Detailed Description

A content datatype which handles object relations.

Definition at line 18 of file ezobjectrelationtype.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZObjectRelationType::__construct | ( |  | ) |

Definition at line 22 of file ezobjectrelationtype.php.

References ezpI18n\tr().

## Member Function Documentation

## ◆ classAttributeContent()

eZObjectRelationType::classAttributeContent | ( |  | $classAttribute | ) |

Returns the content data for the given content class attribute.

Reimplemented from eZDataType.

Definition at line 554 of file ezobjectrelationtype.php.

References createClassContentStructure(), defaultClassAttributeContent(), and parseXML().

Referenced by objectDisplayInformation().

## ◆ createClassContentStructure()

eZObjectRelationType::createClassContentStructure | ( |  | $doc | ) |

Definition at line 580 of file ezobjectrelationtype.php.

References defaultClassAttributeContent().

Referenced by classAttributeContent().

## ◆ createClassDOMDocument()

static eZObjectRelationType::createClassDOMDocument | ( |  | $content | ) |
| static

Definition at line 203 of file ezobjectrelationtype.php.

Referenced by storeClassAttributeContent().

## ◆ customClassAttributeHTTPAction()

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

Definition at line 603 of file ezobjectrelationtype.php.

References eZContentBrowse\browse(), eZContentBrowse\result(), and eZDebug\writeError().

## ◆ customObjectAttributeHTTPAction()

eZObjectRelationType::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 409 of file ezobjectrelationtype.php.

References eZContentBrowse\browse(), eZContentBrowse\nodeAliasID(), removeContentObjectRelation(), and eZDebug\writeError().

## ◆ defaultClassAttributeContent()

eZObjectRelationType::defaultClassAttributeContent | ( |  | ) |

Definition at line 523 of file ezobjectrelationtype.php.

Referenced by classAttributeContent(), createClassContentStructure(), initializeClassAttribute(), and preStoreClassAttribute().

## ◆ deleteNotVersionedStoredClassAttribute()

eZObjectRelationType::deleteNotVersionedStoredClassAttribute | ( | eZContentClassAttribute | $classAttribute | ) |

Clean up stored class attribute for content class that is not versioned. Note: Default implementation does nothing

Parameters

  eZContentClassAttribute | $classAttribute |

Reimplemented from eZDataType.

Definition at line 575 of file ezobjectrelationtype.php.

References eZPersistentObject\attribute(), and eZContentObjectAttribute\removeRelationsByContentClassAttributeId().

## ◆ domString()

static eZObjectRelationType::domString | ( |  | $domDocument | ) |
| static

Returns
  the XML structure in $domDocument as text. It will take of care of the necessary charset conversions for content storage.

Definition at line 183 of file ezobjectrelationtype.php.

References eZTextCodec\internalCharset(), and eZCharsetInfo\realCharsetCode().

Referenced by storeClassDOMDocument(), and storeObjectDOMDocument().

## ◆ fetchClassAttributeHTTPInput()

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

Fetches the HTTP input for the content class attribute.

Note
  Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 304 of file ezobjectrelationtype.php.

## ◆ fetchObjectAttributeHTTPInput()

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

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

Reimplemented from eZDataType.

Definition at line 76 of file ezobjectrelationtype.php.

References fuzzyTextMatch(), eZCharTransform\instance(), and eZContentObjectTreeNode\subTreeByNodeID().

## ◆ fixupClassAttributeHTTPInput()

eZObjectRelationType::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 300 of file ezobjectrelationtype.php.

## ◆ fromString()

eZObjectRelationType::fromString | ( |  | $contentObjectAttribute,
|  |  | $string
| ) |  |

Reimplemented from eZDataType.

Definition at line 680 of file ezobjectrelationtype.php.

References eZContentObject\fetch().

## ◆ fuzzyTextMatch()

eZObjectRelationType::fuzzyTextMatch | ( |  | $text,
|  |  | $match
| ) |  |
| private

Returns
  a number of how near $match is to $text, the lower the better and 0 is a perfect match.
  `false` if it does not match

Definition at line 142 of file ezobjectrelationtype.php.

Referenced by fetchObjectAttributeHTTPInput().

## ◆ hasObjectAttributeContent()

eZObjectRelationType::hasObjectAttributeContent | ( |  | $contentObjectAttribute | ) |

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

Reimplemented from eZDataType.

Definition at line 707 of file ezobjectrelationtype.php.

References objectAttributeContent().

## ◆ initializeClassAttribute()

eZObjectRelationType::initializeClassAttribute | ( |  | $classAttribute | ) |

Initializes the class attribute with some data.

Note
  Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 347 of file ezobjectrelationtype.php.

References defaultClassAttributeContent(), and storeClassAttributeContent().

## ◆ initializeObjectAttribute()

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

Initializes the class attribute with some data.

Reimplemented from eZDataType.

Definition at line 36 of file ezobjectrelationtype.php.

## ◆ isIndexable()

eZObjectRelationType::isIndexable | ( |  | ) |

Returns
  true if the datatype can be indexed

Reimplemented from eZDataType.

Definition at line 689 of file ezobjectrelationtype.php.

## ◆ isRelationType()

eZObjectRelationType::isRelationType | ( |  | ) |

Indicates if the datatype handles relations

Returns
  bool

Reimplemented from eZDataType.

Definition at line 28 of file ezobjectrelationtype.php.

## ◆ metaData()

eZObjectRelationType::metaData | ( |  | $contentObjectAttribute | ) |

Returns the meta data used for storing search indeces.

Reimplemented from eZDataType.

Definition at line 652 of file ezobjectrelationtype.php.

References eZContentObjectAttribute\metaDataArray(), and objectAttributeContent().

## ◆ objectAttributeContent()

eZObjectRelationType::objectAttributeContent | ( |  | $contentObjectAttribute | ) |

Returns the content.

Reimplemented from eZDataType.

Definition at line 506 of file ezobjectrelationtype.php.

References eZContentObject\fetch().

Referenced by hasObjectAttributeContent(), metaData(), and title().

## ◆ objectDisplayInformation()

eZObjectRelationType::objectDisplayInformation | ( |  | $objectAttribute,
|  |  | $mergeInfo = `false`
| ) |  |

Sets `grouped_input` to `true` when browse mode is active or a dropdown with a fuzzy match is used.

Reimplemented from eZDataType.

Definition at line 532 of file ezobjectrelationtype.php.

References classAttributeContent(), and eZDataType\objectDisplayInformation().

## ◆ parseXML()

static eZObjectRelationType::parseXML | ( |  | $xmlText | ) |
| static

Definition at line 516 of file ezobjectrelationtype.php.

Referenced by classAttributeContent().

## ◆ postUnserializeContentObjectAttribute()

eZObjectRelationType::postUnserializeContentObjectAttribute | ( |  | $package,
|  |  | $objectAttribute
| ) |  |

Reimplemented from eZDataType.

Definition at line 806 of file ezobjectrelationtype.php.

References eZContentObject\fetchByRemoteID().

## ◆ preStoreClassAttribute()

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

Definition at line 357 of file ezobjectrelationtype.php.

References defaultClassAttributeContent(), and storeClassAttributeContent().

## ◆ removeContentObjectRelation()

eZObjectRelationType::removeContentObjectRelation | ( |  | $contentObjectAttribute | ) |
| private

Delete the old version from ezcontentobject_link if count of translations > 1

Definition at line 380 of file ezobjectrelationtype.php.

References eZContentObject\fetch(), and eZContentObject\RELATION_ATTRIBUTE.

Referenced by customObjectAttributeHTTPAction().

## ◆ removeRelatedObjectItem()

eZObjectRelationType::removeRelatedObjectItem | ( |  | $contentObjectAttribute,
|  |  | $objectID
| ) |  |

Removes objects with given ID from the relations list

Reimplemented from eZDataType.

Definition at line 834 of file ezobjectrelationtype.php.

## ◆ serializeContentClassAttribute()

eZObjectRelationType::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 715 of file ezobjectrelationtype.php.

## ◆ serializeContentObjectAttribute()

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

Export related object's remote_id.

Reimplemented from eZDataType.

Definition at line 758 of file ezobjectrelationtype.php.

References eZDataType\createContentObjectAttributeDOMNode(), eZContentObject\fetch(), and eZDebug\writeNotice().

## ◆ sortKey()

eZObjectRelationType::sortKey | ( |  | $objectAttribute | ) |

Returns
  the sort key for the datatype. This is used for sorting on attribute level.

Reimplemented from eZDataType.

Definition at line 544 of file ezobjectrelationtype.php.

## ◆ sortKeyType()

eZObjectRelationType::sortKeyType | ( |  | ) |

Returns
  the type of the sort key int|string False is returned if sorting is not supported

Reimplemented from eZDataType.

Definition at line 549 of file ezobjectrelationtype.php.

## ◆ storeClassAttributeContent()

eZObjectRelationType::storeClassAttributeContent | ( |  | $classAttribute,
|  |  | $content
| ) |  |

Definition at line 154 of file ezobjectrelationtype.php.

References createClassDOMDocument(), and storeClassDOMDocument().

Referenced by initializeClassAttribute(), and preStoreClassAttribute().

## ◆ storeClassDOMDocument()

static eZObjectRelationType::storeClassDOMDocument | ( |  | $doc,
|  |  | $classAttribute
| ) |  |
| static

Definition at line 165 of file ezobjectrelationtype.php.

References domString().

Referenced by storeClassAttributeContent().

## ◆ storeObjectDOMDocument()

static eZObjectRelationType::storeObjectDOMDocument | ( |  | $doc,
|  |  | $objectAttribute
| ) |  |
| static

Definition at line 171 of file ezobjectrelationtype.php.

References domString().

## ◆ supportsBatchInitializeObjectAttribute()

eZObjectRelationType::supportsBatchInitializeObjectAttribute | ( |  | ) |

Reimplemented from eZDataType.

Definition at line 840 of file ezobjectrelationtype.php.

## ◆ title()

eZObjectRelationType::title | ( |  | $contentObjectAttribute,
|  |  | $name = `null`
| ) |  |

Returns the content of the string for use as a title

Reimplemented from eZDataType.

Definition at line 697 of file ezobjectrelationtype.php.

References objectAttributeContent().

## ◆ toString()

eZObjectRelationType::toString | ( |  | $contentObjectAttribute | ) |

Returns
  string representation of an contentobjectattribute data for simplified export

Reimplemented from eZDataType.

Definition at line 675 of file ezobjectrelationtype.php.

## ◆ unserializeContentClassAttribute()

eZObjectRelationType::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 733 of file ezobjectrelationtype.php.

## ◆ unserializeContentObjectAttribute()

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

Unserialize contentobject attribute

Parameters

  package |
  objectAttribute | contentobject attribute object
  attributeNode | ezdomnode object

Reimplemented from eZDataType.

Definition at line 783 of file ezobjectrelationtype.php.

References eZContentObject\fetchByRemoteID().

## ◆ validateClassAttributeHTTPInput()

eZObjectRelationType::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 284 of file ezobjectrelationtype.php.

References eZInputValidator\STATE_ACCEPTED, and eZInputValidator\STATE_INVALID.

## ◆ validateObjectAttributeHTTPInput()

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

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

Reimplemented from eZDataType.

Definition at line 49 of file ezobjectrelationtype.php.

References eZInputValidator\STATE_ACCEPTED, eZInputValidator\STATE_INVALID, and ezpI18n\tr().

## Member Data Documentation

## ◆ DATA_TYPE_STRING

const eZObjectRelationType::DATA_TYPE_STRING = "ezobjectrelation"

Definition at line 20 of file ezobjectrelationtype.php.

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

- ezobjectrelationtype.php

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