Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZStringType Class Reference

A content datatype which handles text lines. More...

Inheritance diagram for eZStringType:

## Public Member Functions
| __construct ()
| initializeObjectAttribute ( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
| validateStringHTTPInput ( $data, $contentObjectAttribute, $classAttribute)
| validateObjectAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| validateCollectionAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| fetchObjectAttributeHTTPInput ( $http, $base, $contentObjectAttribute)
| fetchCollectionAttributeHTTPInput ( $collection, $collectionAttribute, $http, $base, $contentObjectAttribute)
| storeObjectAttribute ( $attribute)
| isSimpleStringInsertionSupported ()
| insertSimpleString ( $object, $objectVersion, $objectLanguage, $objectAttribute, $string, &$result)
| storeClassAttribute ( $attribute, $version)
| storeDefinedClassAttribute ( $attribute)
| validateClassAttributeHTTPInput ( $http, $base, $classAttribute)
| fixupClassAttributeHTTPInput ( $http, $base, $classAttribute)
| fetchClassAttributeHTTPInput ( $http, $base, $classAttribute)
| objectAttributeContent ( $contentObjectAttribute)
| metaData ( $contentObjectAttribute)
| toString ( $contentObjectAttribute)
| fromString ( $contentObjectAttribute, $string)
| title ( $contentObjectAttribute, $name=null)
| hasObjectAttributeContent ( $contentObjectAttribute)
| isIndexable ()
| isInformationCollector ()
| sortKey ( $contentObjectAttribute)
| sortKeyType ()
| serializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| unserializeContentClassAttribute ( $classAttribute, $attributeNode, $attributeParametersNode)
| diff ( $old, $new, $options=false)
| supportsBatchInitializeObjectAttribute ()
| batchInitializeObjectAttributeData ( $classAttribute)
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 ()
| isRelationType ()
| insertHTTPFile ( $object, $objectVersion, $objectLanguage, $objectAttribute, $httpFile, $mimeData, &$result)
| insertRegularFile ( $object, $objectVersion, $objectLanguage, $objectAttribute, $filePath, &$result)
| hasStoredFileInformation ( $object, $objectVersion, $objectLanguage, $objectAttribute)
| handleDownload ( $object, $objectVersion, $objectLanguage, $objectAttribute)
| storedFileInformation ( $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)
| fixupCollectionAttributeHTTPInput ( $http, $base, $objectAttribute)
| customObjectAttributeHTTPAction ( $http, $action, $objectAttribute, $parameters)
| handleCustomObjectHTTPActions ( $http, $attributeDataBaseName, $customActionAttributeArray, $customActionParameters)
| initializeClassAttribute ( $classAttribute)
| 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)
| deleteNotVersionedStoredClassAttribute (eZContentClassAttribute $classAttribute)
| contentActionList ( $classAttribute)
| hasInformationCollection ()
| isAddToBasketValidationRequired ()
| validateAddToBasket ( $objectAttribute, $data, &$errors)
| isClassAttributeRemovable ( $classAttribute)
| classAttributeRemovableInformation ( $classAttribute, $includeAll=true)
| customSorting ()
| customSortingSQL ( $params)
| templateList ()
| serializeContentObjectAttribute ( $package, $objectAttribute)
| unserializeContentObjectAttribute ( $package, $objectAttribute, $attributeNode)
| postUnserializeContentObjectAttribute ( $package, $objectAttribute)
| removeRelatedObjectItem ( $contentObjectAttribute, $objectID)
| fixRelatedObjectItem ( $contentObjectAttribute, $objectID, $mode)
| createContentObjectAttributeDOMNode ( $objectAttribute)
| getDBAFileName ()
| getDBAFilePath ( $checkExtensions=true)
| getDBAExtensionFilePath ()
| importDBDataFromDBAFile ( $dbaFilePath=false)

## Public Attributes
const | DATA_TYPE_STRING = 'ezstring'
const | MAX_LEN_FIELD = 'data_int1'
const | MAX_LEN_VARIABLE = '_ezstring_max_string_length_'
const | DEFAULT_STRING_FIELD = "data_text1"
const | DEFAULT_STRING_VARIABLE = "_ezstring_default_value_"
| $MaxLenValidator
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...

## 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

A content datatype which handles text lines.

It provides the functionality to work as a text line and handles class definition input, object definition input and object viewing.

It uses the spare field data_text in a content object attribute for storing the attribute data.

Definition at line 26 of file ezstringtype.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZStringType::__construct | ( |  | ) |

Initializes with a string id and a description.

Definition at line 37 of file ezstringtype.php.

References ezpI18n\tr().

## Member Function Documentation

## ◆ batchInitializeObjectAttributeData()

eZStringType::batchInitializeObjectAttributeData | ( |  | $classAttribute | ) |

Reimplemented from eZDataType.

Definition at line 372 of file ezstringtype.php.

References eZDB\instance(), and eZCharTransform\instance().

## ◆ diff()

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

Definition at line 358 of file ezstringtype.php.

## ◆ fetchClassAttributeHTTPInput()

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

Fetches the HTTP input for the content class attribute.

Note
  Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 252 of file ezstringtype.php.

## ◆ fetchCollectionAttributeHTTPInput()

eZStringType::fetchCollectionAttributeHTTPInput | ( |  | $collection,
|  |  | $collectionAttribute,
|  |  | $http,
|  |  | $base,
|  |  | $contentObjectAttribute
| ) |  |

Fetches the http post variables for collected information

Reimplemented from eZDataType.

Definition at line 169 of file ezstringtype.php.

## ◆ fetchObjectAttributeHTTPInput()

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

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

Reimplemented from eZDataType.

Definition at line 155 of file ezstringtype.php.

## ◆ fixupClassAttributeHTTPInput()

eZStringType::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 240 of file ezstringtype.php.

## ◆ fromString()

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

Reimplemented from eZDataType.

Definition at line 294 of file ezstringtype.php.

## ◆ hasObjectAttributeContent()

eZStringType::hasObjectAttributeContent | ( |  | $contentObjectAttribute | ) |

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

Reimplemented from eZDataType.

Definition at line 308 of file ezstringtype.php.

## ◆ initializeObjectAttribute()

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

Sets the default value.

Reimplemented from eZDataType.

Definition at line 48 of file ezstringtype.php.

## ◆ insertSimpleString()

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

Inserts the string $string in the `'data_text'` database field.

Reimplemented from eZDataType.

Definition at line 199 of file ezstringtype.php.

## ◆ isIndexable()

eZStringType::isIndexable | ( |  | ) |

Returns
  true if the datatype can be indexed

Reimplemented from eZDataType.

Definition at line 313 of file ezstringtype.php.

## ◆ isInformationCollector()

eZStringType::isInformationCollector | ( |  | ) |

Returns
  true if the datatype can be used as an information collector

Reimplemented from eZDataType.

Definition at line 318 of file ezstringtype.php.

## ◆ isSimpleStringInsertionSupported()

eZStringType::isSimpleStringInsertionSupported | ( |  | ) |

Simple string insertion is supported.

Reimplemented from eZDataType.

Definition at line 191 of file ezstringtype.php.

## ◆ metaData()

eZStringType::metaData | ( |  | $contentObjectAttribute | ) |

Returns the meta data used for storing search indeces.

Reimplemented from eZDataType.

Definition at line 281 of file ezstringtype.php.

## ◆ objectAttributeContent()

eZStringType::objectAttributeContent | ( |  | $contentObjectAttribute | ) |

Returns the content.

Reimplemented from eZDataType.

Definition at line 273 of file ezstringtype.php.

## ◆ serializeContentClassAttribute()

eZStringType::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 334 of file ezstringtype.php.

## ◆ sortKey()

eZStringType::sortKey | ( |  | $objectAttribute | ) |

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

Reimplemented from eZDataType.

Definition at line 323 of file ezstringtype.php.

References eZCharTransform\instance().

## ◆ sortKeyType()

eZStringType::sortKeyType | ( |  | ) |

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

Reimplemented from eZDataType.

Definition at line 329 of file ezstringtype.php.

## ◆ storeClassAttribute()

eZStringType::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 210 of file ezstringtype.php.

## ◆ storeDefinedClassAttribute()

eZStringType::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 214 of file ezstringtype.php.

## ◆ storeObjectAttribute()

eZStringType::storeObjectAttribute | ( |  | $attribute | ) |

Does nothing since it uses the data_text field in the content object attribute. See fetchObjectAttributeHTTPInput for the actual storing.

Reimplemented from eZDataType.

Definition at line 184 of file ezstringtype.php.

## ◆ supportsBatchInitializeObjectAttribute()

eZStringType::supportsBatchInitializeObjectAttribute | ( |  | ) |

Reimplemented from eZDataType.

Definition at line 367 of file ezstringtype.php.

## ◆ title()

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

Returns the content of the string for use as a title

Reimplemented from eZDataType.

Definition at line 303 of file ezstringtype.php.

## ◆ toString()

eZStringType::toString | ( |  | $contentObjectAttribute | ) |

Returns
  string representation of an contentobjectattribute data for simplified export

Reimplemented from eZDataType.

Definition at line 289 of file ezstringtype.php.

## ◆ unserializeContentClassAttribute()

eZStringType::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 350 of file ezstringtype.php.

## ◆ validateClassAttributeHTTPInput()

eZStringType::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 218 of file ezstringtype.php.

References eZInputValidator\STATE_ACCEPTED, and eZInputValidator\STATE_INVALID.

## ◆ validateCollectionAttributeHTTPInput()

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

Definition at line 125 of file ezstringtype.php.

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

## ◆ validateObjectAttributeHTTPInput()

eZStringType::validateObjectAttributeHTTPInput | ( |  | $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 from eZDataType.

Definition at line 94 of file ezstringtype.php.

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

## ◆ validateStringHTTPInput()

eZStringType::validateStringHTTPInput | ( |  | $data,
|  |  | $contentObjectAttribute,
|  |  | $classAttribute
| ) |  |

Validates $data with the constraints defined on the class attribute

Parameters

  | $data |
  eZContentObjectAttribute | $contentObjectAttribute |
  eZContentClassAttribute | $classAttribute |

Returns
  int

Definition at line 78 of file ezstringtype.php.

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

Referenced by validateCollectionAttributeHTTPInput(), and validateObjectAttributeHTTPInput().

## Member Data Documentation

## ◆ $MaxLenValidator

eZStringType::$MaxLenValidator

The max len validator

Definition at line 389 of file ezstringtype.php.

## ◆ DATA_TYPE_STRING

const eZStringType::DATA_TYPE_STRING = 'ezstring'

Definition at line 28 of file ezstringtype.php.

## ◆ DEFAULT_STRING_FIELD

const eZStringType::DEFAULT_STRING_FIELD = "data_text1"

Definition at line 31 of file ezstringtype.php.

## ◆ DEFAULT_STRING_VARIABLE

const eZStringType::DEFAULT_STRING_VARIABLE = "_ezstring_default_value_"

Definition at line 32 of file ezstringtype.php.

## ◆ MAX_LEN_FIELD

const eZStringType::MAX_LEN_FIELD = 'data_int1'

Definition at line 29 of file ezstringtype.php.

## ◆ MAX_LEN_VARIABLE

const eZStringType::MAX_LEN_VARIABLE = '_ezstring_max_string_length_'

Definition at line 30 of file ezstringtype.php.

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

- ezstringtype.php

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