eZPublishCommunityProject(LegacyStack)  2013.6
eZContentObjectAttribute Class Reference

Encapsulates the data for an object attribute. More...

+ Inheritance diagram for eZContentObjectAttribute:
+ Collaboration diagram for eZContentObjectAttribute:

Public Member Functions

 classContent ()
 
 classDisplayInfo ()
 
 cloneContentObjectAttribute ($newVersionNumber, $currentVersionNumber, $contentObjectID=false, $newLanguageCode=false)
 Clones the attribute to a new version. More...
 
 collectInformation ($collection, &$collectionAttribute, $http, $base)
 
 content ()
 
 contentActionList ()
 
 contentClassAttribute ()
 
 contentClassAttributeCanTranslate ()
 
 contentClassAttributeIdentifier ()
 
 contentClassAttributeIsInformationCollector ()
 
 contentClassAttributeIsRequired ()
 
 contentClassAttributeName ()
 
 customHTTPAction ($http, $action, $parameters=array())
 
 dataType ()
 
 displayInfo ()
 
 editTemplate ()
 
 editTemplateName ()
 
 eZContentObjectAttribute ($row)
 
 fetchAttributeTranslations ($asObject=true)
 
 fetchInput ($http, $base)
 
 fixupInput ($http, $base)
 
 fromString ($string)
 
 handleCustomHTTPActions ($http, $attributeDataBaseName, $customActionAttributeArray, $customActionParameters)
 
 handleDownload ($object, $objectVersion, $objectLanguage)
 
 hasContent ()
 
 hasHTTPValue ()
 
 hasStoredFileInformation ($object, $objectVersion, $objectLanguage)
 
 hasValidationError ()
 
 informationTemplate ()
 
 initialize ($currentVersion=null, $originalContentObjectAttribute=null)
 Initializes the attribute by using the datatype. More...
 
 inputParameters ()
 
 insertHTTPFile ($object, $objectVersion, $objectLanguage, $httpFile, $mimeData, &$result)
 
 insertRegularFile ($object, $objectVersion, $objectLanguage, $filePath, &$result)
 
 insertSimpleString ($object, $objectVersion, $objectLanguage, $string, &$result)
 
 isA ()
 
 language ($languageCode=false, $asObject=true)
 
 metaData ()
 
 object ()
 
 objectVersion ()
 
 onPublish ($object, $nodes)
 
 postInitialize ($currentVersion=null, $originalContentObjectAttribute=null)
 
 postUnserialize ($package)
 
 removeThis ($id, $currentVersion=null)
 
 resultTemplate ()
 
 serialize ($package)
 
 setContent ($content)
 
 setContentClassAttributeCanTranslate ($canTranslate)
 
 setContentClassAttributeIdentifier ($identifier)
 
 setContentClassAttributeName ($name)
 
 setHasValidationError ($hasError=true)
 
 setHTTPValue ($value)
 
 setInputParameters ($parameters)
 
 setValidationError ()
 
 setValidationLog ($text)
 
 setValidationParameters ($parameters)
 
 store ($fieldFilters=null)
 
 storeData ()
 
 storedFileInformation ($object, $objectVersion, $objectLanguage)
 
 storeNewRow ()
 
 title ()
 
 toString ()
 
 translateTo ($languageCode, $updateLanguageMask=true)
 
 unserialize ($package, $attributeDOMNode)
 
 unsetInputParameters ()
 
 unsetValidationParameters ()
 
 updateSortKey ($storeData=true)
 
 validateAddToBasket ($data, &$errors)
 
 validateInformation ($http, $base, &$inputParameters, $validationParameters=array())
 
 validateInput ($http, $base, &$inputParameters, $validationParameters=array())
 
 validateIsRequired ()
 
 validationError ()
 
 validationLog ()
 
 validationParameters ()
 
 value ()
 
 viewTemplate ()
 
 viewTemplateName ()
 
- Public Member Functions inherited from eZPersistentObject
 attribute ($attr, $noFunction=false)
 Returns the attribute data for $attr, this is either returned from the member variables or a member function depending on whether the definition field or function attributes matched. More...
 
 attributes ()
 Returns the attributes for this object, taken from the definition fields and function attributes. More...
 
 eZPersistentObject ($row)
 Initializes the object with the $row. More...
 
 fill ($row)
 Tries to fill in the data in the object by using the object definition which is returned by the function definition() and the database row data $row. More...
 
 hasAttribute ($attr)
 Checks if $attr is part of the definition fields or function attributes. More...
 
 hasDirtyData ()
 Returns true if the data is considered dirty and needs to be stored. More...
 
 remove ($conditions=null, $extraConditions=null)
 Removes the object from the database, it will use the keys in the object definition to figure out which table row should be removed unless $conditions is defined as an array with fieldnames. More...
 
 setAttribute ($attr, $val)
 Sets the attribute $attr to the value $val. More...
 
 setHasDirtyData ($hasDirtyData)
 Sets whether the object has dirty data or not. More...
 
 store ($fieldFilters=null)
 Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it. More...
 
 sync ($fieldFilters=null)
 Makes sure data is stored if the data is considered dirty. More...
 

Static Public Member Functions

static create ($contentclassAttributeID, $contentobjectID, $version=1, $languageCode=false)
 
static definition ()
 
static fetch ($id, $version, $asObject=true, $field_filters=null)
 
static fetchByClassAttributeID ($classAttributeID, $objectID, $version, $languageID, $asObject=true)
 
static fetchByIdentifier ($identifier, $asObject=true)
 
static fetchListByClassID ($id, $version=false, $limit=null, $asObject=true, $asCount=false)
 
static fetchSameClassAttributeIDList ($contentClassAttributeID, $asObject=true, $version=false, $contentObjectID=false, $limit=null)
 Fetches all contentobject attributes which relate to the contentclass attribute $contentClassAttributeID. More...
 
static generateValidationErrorText ($numargs, $argList)
 
static metaDataArray (&$attributes)
 
- Static Public Member Functions inherited from eZPersistentObject
static conditionText ($conditions)
 Calls conditionTextByRow with an empty row and $conditions. More...
 
static conditionTextByRow ($conditions, $row)
 Generates an SQL sentence from the conditions $conditions and row data $row. More...
 
static count ($def, $conds=null, $field=null)
 Fetches the number of rows by using the object definition. More...
 
static definition ()
 Returns the definition for the object, the default implementation is to return an empty array. More...
 
static escapeArray ($array)
 Escapes strings in an array with the help of eZDBInterface::escapeString(). More...
 
static fetchObject ($def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
 Fetches and returns an object based on the given parameters and returns is either as an object or as an array. More...
 
static fetchObjectList ($def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
 Creates an SQL query out of the different parameters and returns an array with the result. More...
 
static getShortAttributeName ($db, $def, $attrName)
 Returns the short attribute name (alias) if it's defined, given attribute name otherwise. More...
 
static handleRows ($rows, $class_name, $asObject)
 Creates PHP objects out of the database rows $rows. More...
 
static newObjectOrder ($def, $orderField, $conditions)
 Returns an order value which can be used for new items in table, for instance placement. More...
 
static removeObject ($def, $conditions=null, $extraConditions=null)
 Deletes the object from the table defined in $def with conditions $conditions and extra conditions $extraConditions. More...
 
static reorderObject ($def, $orderField, $conditions, $down=true)
 Moves a row in a database table. More...
 
static replaceFieldsWithShortNames ($db, $fieldDefs, &$fields)
 For the given array $fields treats its keys (for associative array) or values (for non-associative array) as table fields names and replaces them with short names (aliases) found in $fieldDefs. More...
 
static storeObject ($obj, $fieldFilters=null)
 Stores the data in $obj to database. More...
 
static swapRow ($table, $keys, $order_id, $rows, $id1, $id2)
 Sets row id $id2 to have the placement of row id $id1. More...
 
static updateObjectList ($parameters)
 Updates rows matching the given parameters. More...
 

Public Attributes

 $Content
 Contains the content for this attribute. More...
 
 $ContentClassAttributeCanTranslate
 
 $ContentClassAttributeID
 
 $ContentClassAttributeIdentifier
 
 $ContentClassAttributeIsInformationCollector
 
 $ContentClassAttributeIsRequired
 
 $ContentClassAttributeName
 
 $DisplayInfo
 Contains information on how to display the current attribute in various viewmodes. More...
 
 $HTTPValue
 Contains the value(s) submitted in HTTP form. More...
 
 $IsValid
 Stores the is valid. More...
 
 $ValidationError
 Contains the last validation error. More...
 
 $ValidationLog
 Contains the last validation error. More...
 
 $ValidationParameters = array()
 
- Public Attributes inherited from eZPersistentObject
 $PersistentDataDirty
 

Detailed Description

Encapsulates the data for an object attribute.

See Also
eZContentObject eZContentClass eZContentClassAttribute

Member Function Documentation

eZContentObjectAttribute::classContent ( )
Returns
the content for the contentclass attribute which defines this contentobject attribute.
eZContentObjectAttribute::classDisplayInfo ( )
Returns
Information on how to display the class attribute. See eZDataType::classDisplayInformation() for more information on what is returned.
Note
This is a copy of eZContentClassAttribute::displayInfo()
eZContentObjectAttribute::cloneContentObjectAttribute (   $newVersionNumber,
  $currentVersionNumber,
  $contentObjectID = false,
  $newLanguageCode = false 
)

Clones the attribute to a new version.

Parameters
int$newVersionNumberTarget version number
int$currentVersionNumnberSource version number
int$contentObjectID
string$newLanguageCode
Note
The cloned attribute isn't stored automatically
Returns
eZContentObjectAttribute The cloned attribute
Todo:
Deprecate this in favor of a real __clone
eZContentObjectAttribute::collectInformation (   $collection,
$collectionAttribute,
  $http,
  $base 
)

Collects the information entered by the user from http post vars

eZContentObjectAttribute::content ( )

Returns the content for this attribute.

Referenced by value().

eZContentObjectAttribute::contentActionList ( )

Returns the content action(s) for this attribute

eZContentObjectAttribute::contentClassAttribute ( )

Returns the attribute for the current data attribute instance

Referenced by classContent(), classDisplayInfo(), contentActionList(), initialize(), postInitialize(), store(), storeData(), updateSortKey(), validateIsRequired(), and viewTemplateName().

eZContentObjectAttribute::contentClassAttributeCanTranslate ( )
Returns
the cached value if the attribute can be translated or not
eZContentObjectAttribute::contentClassAttributeIdentifier ( )
Returns
the idenfifier for the content class attribute
eZContentObjectAttribute::contentClassAttributeIsInformationCollector ( )
Returns
the cached value of the is_informationcollector value
eZContentObjectAttribute::contentClassAttributeIsRequired ( )
Returns
the cached value of the IsRequired value
eZContentObjectAttribute::contentClassAttributeName ( )
Returns
the cached value of the class attribute name
static eZContentObjectAttribute::create (   $contentclassAttributeID,
  $contentobjectID,
  $version = 1,
  $languageCode = false 
)
static
eZContentObjectAttribute::customHTTPAction (   $http,
  $action,
  $parameters = array() 
)

Executes the custom HTTP action

eZContentObjectAttribute::displayInfo ( )
Returns
Information on how to display the current attribute. See eZDataType::objectDisplayInformation() for more information on what is returned.
eZContentObjectAttribute::editTemplate ( )
Returns
the template name to use for editing the attribute.
Note
The returned template name does not include the .tpl extension.
See Also
viewTemplate, informationTemplate

Referenced by editTemplateName().

eZContentObjectAttribute::editTemplateName ( )
Returns
the template name to use for editing the attribute.
eZContentObjectAttribute::eZContentObjectAttribute (   $row)

Referenced by create().

eZContentObjectAttribute::fetchAttributeTranslations (   $asObject = true)
Returns
the attributes with alternative translations for the current attribute version and class attribute id
static eZContentObjectAttribute::fetchByClassAttributeID (   $classAttributeID,
  $objectID,
  $version,
  $languageID,
  $asObject = true 
)
static
static eZContentObjectAttribute::fetchByIdentifier (   $identifier,
  $asObject = true 
)
static

Fetch a node by identifier (unique data_text )

Parameters
identifier
Returns
object attribute

Referenced by eZContentFunctionCollection\fetchObjectByAttribute().

eZContentObjectAttribute::fetchInput (   $http,
  $base 
)

Fetches the data from http post vars and sets them correctly.

static eZContentObjectAttribute::fetchListByClassID (   $id,
  $version = false,
  $limit = null,
  $asObject = true,
  $asCount = false 
)
static
static eZContentObjectAttribute::fetchSameClassAttributeIDList (   $contentClassAttributeID,
  $asObject = true,
  $version = false,
  $contentObjectID = false,
  $limit = null 
)
static

Fetches all contentobject attributes which relate to the contentclass attribute $contentClassAttributeID.

Parameters
int$contentClassAttributeIDThe ID of the contentclass attribute
bool$asObjectIf true objects will be returned, otherwise associative arrays are returned.
int | bool$versionThe version the of contentobject attributes to fetch, or all versions if false.
int | bool$contentObjectIDThe ID the of contentobject to fetch, or all objects if false.
array | null$limitAn associative array with limitiations, can contain
  • 'offset': Numerical value defining the start offset for the fetch
  • 'length': Numerical value defining the max number of items to return
Returns
eZContentObjectAttribute[]|array|null An array with contentobject attributes.

Referenced by eZSiteInstaller\removeClassAttribute(), and eZContentClassEditHandler\store().

eZContentObjectAttribute::fixupInput (   $http,
  $base 
)

Tries to fixup the input text to be acceptable. ???

eZContentObjectAttribute::fromString (   $string)

imports string to attribute content used for simplified import/export.

static eZContentObjectAttribute::generateValidationErrorText (   $numargs,
  $argList 
)
static

Referenced by setValidationError().

eZContentObjectAttribute::handleCustomHTTPActions (   $http,
  $attributeDataBaseName,
  $customActionAttributeArray,
  $customActionParameters 
)

Sends custom actions to datatype for custom handling.

eZContentObjectAttribute::handleDownload (   $object,
  $objectVersion,
  $objectLanguage 
)

Calls handleDownload() on the current datatype and returns the result.

eZContentObjectAttribute::hasContent ( )
Returns
true if the attribute is considered to have any content at all (ie. non-empty).

It will call the hasObjectAttributeContent() for the current datatype to figure this out.

eZContentObjectAttribute::hasHTTPValue ( )
Returns
true if the attribute has relavant value(s) submitted in HTTP form.
eZContentObjectAttribute::hasStoredFileInformation (   $object,
  $objectVersion,
  $objectLanguage 
)

Calls hasStoredFileInformation() on the current datatype and returns the result.

eZContentObjectAttribute::hasValidationError ( )
eZContentObjectAttribute::informationTemplate ( )
Returns
the template name to use for information collection for the attribute.
Note
The returned template name does not include the .tpl extension.
See Also
viewTemplate, editTemplate

Referenced by viewTemplateName().

eZContentObjectAttribute::initialize (   $currentVersion = null,
  $originalContentObjectAttribute = null 
)

Initializes the attribute by using the datatype.

Parameters
int$currentVersionCurrent version number
eZContentObjectAttribute$originalContentObjectAttributeOptional eZContentObjectAttribute the content will be initialized from
Returns
void
eZContentObjectAttribute::inputParameters ( )
Returns
the current input parameters or false if no parameters has been set.
See Also
setInputParameters, unsetInputParameters
eZContentObjectAttribute::insertHTTPFile (   $object,
  $objectVersion,
  $objectLanguage,
  $httpFile,
  $mimeData,
$result 
)

Inserts the HTTP file $httpFile to the content object attribute $objectAttribute by calling eZDataType::insertHTTPFile on the current datatype.

The parameters are passed directly to the datatype with the exception of $object, $objectVersion and $objectLanguage. If false is passed to any of these parameters they will be fetched from the current attribute, if these are available it is adviced to pass them since it will save time.

eZContentObjectAttribute::insertRegularFile (   $object,
  $objectVersion,
  $objectLanguage,
  $filePath,
$result 
)

Inserts the file named $filePath to the content object attribute $objectAttribute. by calling eZDataType::insertRegularFile on the current datatype.

The parameters are passed directly to the datatype with the exception of $object, $objectVersion and $objectLanguage. If false is passed to any of these parameters they will be fetched from the current attribute, if these are available it is adviced to pass them since it will save time.

eZContentObjectAttribute::insertSimpleString (   $object,
  $objectVersion,
  $objectLanguage,
  $string,
$result 
)

Inserts the string $string to the content object attribute $objectAttribute. by calling eZDataType::insertSimpleString on the current datatype.

The parameters are passed directly to the datatype with the exception of $object, $objectVersion and $objectLanguage. If false is passed to any of these parameters they will be fetched from the current attribute, if these are available it is adviced to pass them since it will save time.

eZContentObjectAttribute::isA ( )
eZContentObjectAttribute::language (   $languageCode = false,
  $asObject = true 
)
eZContentObjectAttribute::metaData ( )

Returns the metadata. This is the pure content of the attribute used for indexing data for search engines.

static eZContentObjectAttribute::metaDataArray ( $attributes)
static

Goes trough all attributes and fetches metadata for the ones that is searchable.

Returns
an array with metadata information.

Referenced by eZObjectRelationType\metaData(), and eZObjectRelationListType\metaData().

eZContentObjectAttribute::objectVersion ( )
eZContentObjectAttribute::onPublish (   $object,
  $nodes 
)
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.
eZContentObjectAttribute::postInitialize (   $currentVersion = null,
  $originalContentObjectAttribute = null 
)

Initialized the attribute by using the datatype after the actual attribute is stored.

eZContentObjectAttribute::postUnserialize (   $package)
eZContentObjectAttribute::removeThis (   $id,
  $currentVersion = null 
)

Remove the attribute by using the datatype.

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.
eZContentObjectAttribute::resultTemplate ( )
Returns
the template name to use for information collection result view for the attribute.
Note
The returned template name does not include the .tpl extension.
See Also
viewTemplate, editTemplate, informationTemplate
eZContentObjectAttribute::serialize (   $package)
eZContentObjectAttribute::setContent (   $content)

Sets the content for the current attribute

eZContentObjectAttribute::setContentClassAttributeCanTranslate (   $canTranslate)

Sets the cached content class attribute can_translate

eZContentObjectAttribute::setContentClassAttributeIdentifier (   $identifier)

Sets the cached content class attribute identifier

eZContentObjectAttribute::setContentClassAttributeName (   $name)

Sets the cached content class attribute name

eZContentObjectAttribute::setHasValidationError (   $hasError = true)
eZContentObjectAttribute::setHTTPValue (   $value)

Sets the content of variable for the content of the relevant value(s) submitted in HTTP form.

eZContentObjectAttribute::setInputParameters (   $parameters)

Sets the current input parameters to $parameters. The input parameters are set by validateInput() and made avaiable to datatypes trough the function inputParameters().

Note
The input parameters will only be available for the duration of validateInput().
See Also
inputParameters

Referenced by validateInformation(), and validateInput().

eZContentObjectAttribute::setValidationError ( )
eZContentObjectAttribute::setValidationLog (   $text)
eZContentObjectAttribute::setValidationParameters (   $parameters)

Sets the current validation parameters to $parameters. The validation parameters are set by validateInput() and made avaiable to datatypes trough the function validationParameters().

Note
The validation parameters will only be available for the duration of validateInput().
See Also
validationParameters

Referenced by validateInformation(), and validateInput().

eZContentObjectAttribute::store (   $fieldFilters = null)
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.

Referenced by postUnserialize().

eZContentObjectAttribute::storeData ( )

Similar to store() but does not call eZDataType::storeObjectAttribute().

If you have some datatype code that needs to store attribute data you should call this instead of store(), this function will avoid infinite recursion.

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.
eZContentObjectAttribute::storedFileInformation (   $object,
  $objectVersion,
  $objectLanguage 
)

Calls storedFileInformation() on the current datatype and returns the result.

eZContentObjectAttribute::storeNewRow ( )

Store one row into content attribute table

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.
eZContentObjectAttribute::title ( )

Fetches the title of the data instance which is to form the title of the object.

eZContentObjectAttribute::toString ( )

Returns the string representation of attribute. This is the pure content of the attribute in string representation used for simplified import/export.

eZContentObjectAttribute::translateTo (   $languageCode,
  $updateLanguageMask = true 
)

Clones the attribute to the translation $languageCode.

Note
The cloned attribute is not stored.
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.
Deprecated.
eZContentObjectAttribute::unserialize (   $package,
  $attributeDOMNode 
)
eZContentObjectAttribute::unsetInputParameters ( )

Unsets the input parameters previously set by setInputParameters().

See Also
inputParameters

Referenced by validateInformation(), and validateInput().

eZContentObjectAttribute::unsetValidationParameters ( )

Unsets the validation parameters previously set by setValidationParameters().

See Also
validationParameters

Referenced by validateInformation(), and validateInput().

eZContentObjectAttribute::updateSortKey (   $storeData = true)

Copies the sort key value from the attribute according to the datatype rules.

Note
The attribute is not stored
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.

Referenced by store(), and storeData().

eZContentObjectAttribute::validateAddToBasket (   $data,
$errors 
)

Validates the data contents, returns true on success false if the data does not validate.

eZContentObjectAttribute::validateInformation (   $http,
  $base,
$inputParameters,
  $validationParameters = array() 
)

Validates the information collection data. ???

eZContentObjectAttribute::validateInput (   $http,
  $base,
$inputParameters,
  $validationParameters = array() 
)

Validates the data contents, returns true on success false if the data does not validate.

eZContentObjectAttribute::validateIsRequired ( )
Returns
true if 'is_required' validation should be done otherwise false;
eZContentObjectAttribute::validationError ( )
eZContentObjectAttribute::validationLog ( )
eZContentObjectAttribute::validationParameters ( )
Returns
the current validation parameters or false if no parameters has been set.
See Also
setValidationParameters, unsetValidationParameters

Referenced by validateIsRequired().

eZContentObjectAttribute::value ( )

Returns the content of the relevant value(s) submitted in HTTP form.

eZContentObjectAttribute::viewTemplate ( )
Returns
the template name to use for viewing the attribute.
Note
The returned template name does not include the .tpl extension.
See Also
editTemplate, informationTemplate

Referenced by viewTemplateName().

eZContentObjectAttribute::viewTemplateName ( )
Returns
the template name to use for viewing the attribute or if the attribute is an information collector the information template name is returned.
Note
The returned template name does not include the .tpl extension.
See Also
editTemplate, informationTemplate

Member Data Documentation

eZContentObjectAttribute::$Content

Contains the content for this attribute.

Referenced by content().

eZContentObjectAttribute::$ContentClassAttributeCanTranslate
eZContentObjectAttribute::$ContentClassAttributeID
eZContentObjectAttribute::$ContentClassAttributeIdentifier
eZContentObjectAttribute::$ContentClassAttributeIsInformationCollector
eZContentObjectAttribute::$ContentClassAttributeIsRequired
eZContentObjectAttribute::$ContentClassAttributeName
eZContentObjectAttribute::$DisplayInfo

Contains information on how to display the current attribute in various viewmodes.

Referenced by displayInfo().

eZContentObjectAttribute::$HTTPValue

Contains the value(s) submitted in HTTP form.

Referenced by value().

eZContentObjectAttribute::$IsValid

Stores the is valid.

Referenced by validateInformation(), and validateInput().

eZContentObjectAttribute::$ValidationError

Contains the last validation error.

Referenced by validationError().

eZContentObjectAttribute::$ValidationLog

Contains the last validation error.

Referenced by validationLog().

eZContentObjectAttribute::$ValidationParameters = array()

Referenced by validationParameters().


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