eZ Publish  [trunk]
eZContentObjectAttribute Class Reference

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

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

List of all members.

Public Member Functions

 classContent ()
 classDisplayInfo ()
 cloneContentObjectAttribute ($newVersionNumber, $currentVersionNumber, $contentObjectID=false, $newLanguageCode=false)
 Clones the attribute to a new version.
 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.
 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 ()

Static Public Member Functions

static create ($contentclassAttributeID, $contentobjectID, $version=1, $languageCode=false)
static definition ()
 Returns the definition for the object, the default implementation is to return an empty array.
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)
static generateValidationErrorText ($numargs, $argList)
static metaDataArray (&$attributes)

Public Attributes

 $Content
 Contains the content for this attribute.
 $ContentClassAttributeCanTranslate
 $ContentClassAttributeID
 $ContentClassAttributeIdentifier
 $ContentClassAttributeIsInformationCollector
 $ContentClassAttributeIsRequired
 $ContentClassAttributeName
 $DisplayInfo
 Contains information on how to display the current attribute in various viewmodes.
 $HTTPValue
 Contains the value(s) submitted in HTTP form.
 $IsValid
 Stores the is valid.
 $ValidationError
 Contains the last validation error.
 $ValidationLog
 Contains the last validation error.

Detailed Description

Encapsulates the data for an object attribute.

See also:
eZContentObject eZContentClass eZContentClassAttribute

Definition at line 19 of file ezcontentobjectattribute.php.


Member Function Documentation

Returns:
the content for the contentclass attribute which defines this contentobject attribute.

Definition at line 1056 of file ezcontentobjectattribute.php.

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()

Definition at line 1219 of file ezcontentobjectattribute.php.

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

Definition at line 925 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::collectInformation ( collection,
&$  collectionAttribute,
http,
base 
)

Collects the information entered by the user from http post vars

Definition at line 682 of file ezcontentobjectattribute.php.

Returns the content for this attribute.

Definition at line 1096 of file ezcontentobjectattribute.php.

Referenced by value().

Returns the content action(s) for this attribute

Definition at line 1236 of file ezcontentobjectattribute.php.

Returns:
the cached value if the attribute can be translated or not

Definition at line 496 of file ezcontentobjectattribute.php.

Returns:
the idenfifier for the content class attribute

Definition at line 521 of file ezcontentobjectattribute.php.

Returns:
the cached value of the is_informationcollector value

Definition at line 462 of file ezcontentobjectattribute.php.

Returns:
the cached value of the IsRequired value

Definition at line 445 of file ezcontentobjectattribute.php.

Returns:
the cached value of the class attribute name

Definition at line 479 of file ezcontentobjectattribute.php.

static eZContentObjectAttribute::create ( contentclassAttributeID,
contentobjectID,
version = 1,
languageCode = false 
) [static]

Definition at line 229 of file ezcontentobjectattribute.php.

Referenced by eZSiteInstaller\addClassAttributes(), and dataType().

eZContentObjectAttribute::customHTTPAction ( http,
action,
parameters = array() 
)

Executes the custom HTTP action

Definition at line 699 of file ezcontentobjectattribute.php.

Returns the definition for the object, the default implementation is to return an empty array.

It's upto each inheriting class to return a proper definition array.

The definition array is an associative array consists of these keys:

  • fields: an associative array of fields which defines which database field (the key) is to fetched and how they map to object member variables (the value).
  • keys: an array of fields which is used for uniquely identifying the object in the table.
  • function_attributes: an associative array of attributes which maps to member functions, used for fetching data with functions.
  • set_functions: an associative array of attributes which maps to member functions, used for setting data with functions.
  • increment_key: the field which is incremented on table inserts.
  • class_name: the classname which is used for instantiating new objecs when fetching from the database.
  • sort: an associative array which defines the default sorting of lists, the key is the table field while the value is the sorting method which is either 'asc' or 'desc'.
  • name: the name of the database table

Example: public static function definition() { return array( "fields" => array( "id" => "ID", "version" => "Version", "name" => "Name" ), "keys" => array( "id", "version" ), "function_attributes" => array( "current" => "currentVersion", "class_name" => "className" ), "increment_key" => "id", "class_name" => "eZContentClass", "sort" => array( "id" => "asc" ), "name" => "ezcontentclass" ); }

Returns:
array

Reimplemented from eZPersistentObject.

Definition at line 36 of file ezcontentobjectattribute.php.

Referenced by eZContentObject\allContentObjectAttributes(), cloneContentObjectAttribute(), copySubtree(), fetch(), fetchAttributeTranslations(), fetchByClassAttributeID(), eZMedia\fetchByContentObjectID(), fetchByIdentifier(), eZImageFile\fetchImageAttributesByFilepath(), fetchListByClassID(), fetchSameClassAttributeIDList(), language(), eZObjectRelationListType\removeRelationObject(), removeThis(), and eZISBN10To13Converter\updateContentFromClassAttribute().

Returns:
Information on how to display the current attribute. See eZDataType::objectDisplayInformation() for more information on what is returned.

Definition at line 1203 of file ezcontentobjectattribute.php.

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

Definition at line 1403 of file ezcontentobjectattribute.php.

Referenced by editTemplateName().

Returns:
the template name to use for editing the attribute.

Definition at line 1374 of file ezcontentobjectattribute.php.

Definition at line 21 of file ezcontentobjectattribute.php.

Referenced by create().

Returns:
the attributes with alternative translations for the current attribute version and class attribute id

Definition at line 217 of file ezcontentobjectattribute.php.

static eZContentObjectAttribute::fetchByClassAttributeID ( classAttributeID,
objectID,
version,
languageID,
asObject = true 
) [static]

Definition at line 180 of file ezcontentobjectattribute.php.

Referenced by eZContentObject\copyVersion().

static eZContentObjectAttribute::fetchByIdentifier ( identifier,
asObject = true 
) [static]

Fetch a node by identifier (unique data_text )

Parameters:
identifier
Returns:
object attribute

Definition at line 365 of file ezcontentobjectattribute.php.

Referenced by eZContentFunctionCollection\fetchObjectByAttribute().

eZContentObjectAttribute::fetchInput ( http,
base 
)

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

Definition at line 652 of file ezcontentobjectattribute.php.

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

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

Returns:
An array with contentobject attributes.
Parameters:
$contentClassAttributeIDThe ID of the contentclass attribute
$asObjectIf true objects will be returned, otherwise associative arrays are returned.
$versionThe version the of contentobject attributes to fetch or all version if false.
$contentObjectIDThe ID the of contentobject to fetch or all objects if false.

Definition at line 199 of file ezcontentobjectattribute.php.

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

eZContentObjectAttribute::fixupInput ( http,
base 
)

Tries to fixup the input text to be acceptable. �

Definition at line 642 of file ezcontentobjectattribute.php.

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

Definition at line 1150 of file ezcontentobjectattribute.php.

static eZContentObjectAttribute::generateValidationErrorText ( numargs,
argList 
) [static]

Definition at line 1270 of file ezcontentobjectattribute.php.

Referenced by setValidationError().

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

Sends custom actions to datatype for custom handling.

Definition at line 709 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::handleDownload ( object,
objectVersion,
objectLanguage 
)

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

Definition at line 842 of file ezcontentobjectattribute.php.

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.

Definition at line 1112 of file ezcontentobjectattribute.php.

Returns:
true if the attribute has relavant value(s) submitted in HTTP form.

Definition at line 1084 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::hasStoredFileInformation ( object,
objectVersion,
objectLanguage 
)

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

Definition at line 810 of file ezcontentobjectattribute.php.

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

Definition at line 1418 of file ezcontentobjectattribute.php.

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

Definition at line 864 of file ezcontentobjectattribute.php.

Returns:
the current input parameters or false if no parameters has been set.
See also:
setInputParameters, unsetInputParameters

Definition at line 590 of file ezcontentobjectattribute.php.

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.

Definition at line 741 of file ezcontentobjectattribute.php.

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.

Definition at line 766 of file ezcontentobjectattribute.php.

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.

Definition at line 791 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::language ( languageCode = false,
asObject = true 
)

Definition at line 373 of file ezcontentobjectattribute.php.

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

Definition at line 1126 of file ezcontentobjectattribute.php.

static eZContentObjectAttribute::metaDataArray ( &$  attributes) [static]

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

Returns:
an array with metadata information.

Definition at line 1165 of file ezcontentobjectattribute.php.

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

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.

Definition at line 725 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::postInitialize ( currentVersion = null,
originalContentObjectAttribute = null 
)

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

Definition at line 877 of file ezcontentobjectattribute.php.

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.

Definition at line 892 of file ezcontentobjectattribute.php.

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

Definition at line 1436 of file ezcontentobjectattribute.php.

Definition at line 1309 of file ezcontentobjectattribute.php.

Sets the content for the current attribute

Definition at line 1194 of file ezcontentobjectattribute.php.

Sets the cached content class attribute can_translate

Definition at line 429 of file ezcontentobjectattribute.php.

Sets the cached content class attribute identifier

Definition at line 421 of file ezcontentobjectattribute.php.

Sets the cached content class attribute name

Definition at line 437 of file ezcontentobjectattribute.php.

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

Definition at line 1065 of file ezcontentobjectattribute.php.

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

Definition at line 571 of file ezcontentobjectattribute.php.

Referenced by validateInformation(), and validateInput().

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

Definition at line 602 of file ezcontentobjectattribute.php.

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.

Reimplemented from eZPersistentObject.

Definition at line 255 of file ezcontentobjectattribute.php.

Referenced by postUnserialize(), storeData(), storeNewRow(), and updateSortKey().

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.

Definition at line 291 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::storedFileInformation ( object,
objectVersion,
objectLanguage 
)

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

Definition at line 826 of file ezcontentobjectattribute.php.

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.

Definition at line 353 of file ezcontentobjectattribute.php.

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

Definition at line 1044 of file ezcontentobjectattribute.php.

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

Definition at line 1138 of file ezcontentobjectattribute.php.

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.

Definition at line 999 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::unserialize ( package,
attributeDOMNode 
)

Definition at line 1319 of file ezcontentobjectattribute.php.

Unsets the input parameters previously set by setInputParameters().

See also:
inputParameters

Definition at line 580 of file ezcontentobjectattribute.php.

Referenced by validateInformation(), and validateInput().

Unsets the validation parameters previously set by setValidationParameters().

See also:
validationParameters

Definition at line 611 of file ezcontentobjectattribute.php.

Referenced by validateInformation(), and validateInput().

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.

Definition at line 313 of file ezcontentobjectattribute.php.

Referenced by store(), and storeData().

eZContentObjectAttribute::validateAddToBasket ( data,
&$  errors 
)

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

Definition at line 554 of file ezcontentobjectattribute.php.

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

Validates the information collection data. �

Definition at line 664 of file ezcontentobjectattribute.php.

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

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

Definition at line 535 of file ezcontentobjectattribute.php.

Returns:
true if 'is_required' validation should be done otherwise false;

Definition at line 629 of file ezcontentobjectattribute.php.

Returns:
the current validation parameters or false if no parameters has been set.
See also:
setValidationParameters, unsetValidationParameters

Definition at line 621 of file ezcontentobjectattribute.php.

Referenced by validateIsRequired().

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

Definition at line 1073 of file ezcontentobjectattribute.php.

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

Definition at line 1384 of file ezcontentobjectattribute.php.

Referenced by 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

Definition at line 1356 of file ezcontentobjectattribute.php.


Member Data Documentation

eZContentObjectAttribute::$Content

Contains the content for this attribute.

Definition at line 1453 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$ContentClassAttributeCanTranslate

Definition at line 1471 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$ContentClassAttributeID

Definition at line 1461 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$ContentClassAttributeIdentifier

Definition at line 1470 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$ContentClassAttributeIsInformationCollector

Definition at line 1473 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$ContentClassAttributeIsRequired

Definition at line 1474 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$ContentClassAttributeName

Definition at line 1472 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$DisplayInfo

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

Definition at line 1456 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$HTTPValue

Contains the value(s) submitted in HTTP form.

Definition at line 1450 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$IsValid

Stores the is valid.

Definition at line 1459 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$ValidationError

Contains the last validation error.

Definition at line 1464 of file ezcontentobjectattribute.php.

eZContentObjectAttribute::$ValidationLog

Contains the last validation error.

Definition at line 1467 of file ezcontentobjectattribute.php.


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