eZContentObject Class Reference
[Kernel system]

Handles Exponential content objects. More...

Inheritance diagram for eZContentObject:

eZPersistentObject List of all members.

Public Methods

definition ()
attribute ($attr)
dataMap ()
fetchDataMap ($version=false,$language=false)
owner ()
contentClassIdentifier ()
contentClass ()
currentVersion ($asObject=true)
 version ($version,$asObject=true)
 versions ($asObject=true)
createNewVersion ($copyFromVersion=false)
copyVersion (&$object,&$version,$newVersionNumber,$contentObjectID=false,$status=EZ_VERSION_STATUS_DRAFT)
create ($name,$contentclassID,$userID,$sectionID=1,$version=1)
clone ()
copy ($allVersions=true)
 revertTo ($version)
 copyRevertTo ($version)
 purge ($id=false)
 remove ($id=false,$nodeID=null)
contentObjectAttributes ($asObject=true,$version=false,$language=false)
 setContentObjectAttributes (&$attributes,$version,$language)
parents ()
 nextVersion ()
 getVersionCount ()
 addContentObjectRelation ($objectID,$version)
 removeContentObjectRelation ($objectID,$version=null)
relatedContentObjectCount ($version=false,$objectID=false)
relatedContentObjectArray ($version=false,$objectID=false)
reverseRelatedObjectList ($version=false,$objectID=false)
contentObjectListRelatingThis ($version=false,$objectID=false)
parentNodes ($version=false,$asObject=true)
assignedNodes ($asObject=true)
 setPermissions ($permissionArray)
 permissions ()
 canRead ()
contentActionList ()
 hasContentAction ($name)
 translationStringList ()
translationList ()
serialize ($specificVersion=false)
 cacheInfo ($Params)
 expireAllCache ()
 expireComplexViewModeCache ()
 isCacheExpired ($timestamp)
 isComplexViewMode ($viewMode)
 isComplexViewModeCacheExpired ($viewMode,$timestamp)

Static Public Methods

fillNodeListAttributes (&$nodeList,$asObject=true)
fetchClassAttributes ($version=0,$asObject=true)

Public Attributes

 CurrentLanguage
 Stores the current language.

 ClassName
 Stores the current permissions.

 DataMap = array()
 Contains the datamap for content object attributes.

 ContentActionList = false
 Contains an array of the content object actions for the current object.

 ContentObjectAttributes = array()
 Contains a cached version of the content object attributes for the given version and language.


Detailed Description

Handles Exponential content objects.

It encapsulates the date for an object and provides lots of functions for dealing with versions, translations and attributes.

See also:
eZContentClass

Definition at line ezcontentobject.php.


Member Function Documentation

eZContentObject::addContentObjectRelation   objectID,
  version
 

Adds a link to the given content object id.

Definition at line ezcontentobject.php.

References version().

& eZContentObject::assignedNodes   asObject = true
 

Returns the node assignments for the current object.

Definition at line ezcontentobject.php.

References eZDB::instance().

Referenced by attribute().

& eZContentObject::attribute   attr
 

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.

Reimplemented from eZPersistentObject.

Definition at line ezcontentobject.php.

References versions().

Referenced by parentNodes().

eZContentObject::cacheInfo   Params
 

Returns:
a structure with information required for caching.

Definition at line ezcontentobject.php.

References eZUser::currentUser().

eZContentObject::canRead  
 

Returns true if the current

Definition at line ezcontentobject.php.

Referenced by attribute().

& eZContentObject::clone  
 

Returns:
a new clone of the current object which has is ready to be stored with a new ID.

Definition at line ezcontentobject.php.

Referenced by copy().

& eZContentObject::contentActionList  
 

Returns an array of the content actions which can be performed on the current object.

Definition at line ezcontentobject.php.

References version().

Referenced by contentActionList().

& eZContentObject::contentClass  
 

Returns:
the content class for the current content object

Definition at line ezcontentobject.php.

Referenced by contentClassIdentifier().

& eZContentObject::contentClassIdentifier  
 

Returns:
the content class identifier for the current content object

Definition at line ezcontentobject.php.

References contentClass().

& eZContentObject::contentObjectAttributes   asObject = true,
  version = false,
  language = false
 

Fetches the attributes for the current published version of the object.

Definition at line ezcontentobject.php.

References version().

Referenced by fetchDataMap().

& eZContentObject::contentObjectListRelatingThis   version = false,
  objectID = false
 

Returns the related objects.

Definition at line ezcontentobject.php.

References eZDebugSetting::writeDebug().

& eZContentObject::copy   allVersions = true
 

Makes a copy of the object which is stored and then returns it.

Definition at line ezcontentobject.php.

References eZDebugSetting::writeDebug().

Referenced by copyVersion().

eZContentObject::copyRevertTo   version
 

Copies the given version of the object and creates a new current version.

Definition at line ezcontentobject.php.

References version().

& eZContentObject::copyVersion &$    object,
&$    version,
  newVersionNumber,
  contentObjectID = false,
  status = EZ_VERSION_STATUS_DRAFT
 

Creates a new version and returns it as an eZContentObjectVersion object. If version number is given as argument that version is used to create a copy.

Definition at line ezcontentobject.php.

References eZDebugSetting::writeDebug().

Referenced by createNewVersion().

& eZContentObject::create   name,
  contentclassID,
  userID,
  sectionID = 1,
  version = 1
 

Creates a new content object instance and stores it.

Definition at line ezcontentobject.php.

References version().

& eZContentObject::createNewVersion   copyFromVersion = false
 

Creates a new version and returns it as an eZContentObjectVersion object. If version number is given as argument that version is used to create a copy.

Definition at line ezcontentobject.php.

References version().

Referenced by copyRevertTo().

& eZContentObject::currentVersion   asObject = true
 

Returns the current version of this document.

Definition at line ezcontentobject.php.

Referenced by serialize().

& eZContentObject::dataMap  
 

Returns:
a map with all the content object attributes where the keys are the attribute identifiers.

Definition at line ezcontentobject.php.

References fetchDataMap().

Referenced by attribute().

& eZContentObject::definition  
 

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:
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" );
}

Reimplemented from eZPersistentObject.

Definition at line ezcontentobject.php.

References versions().

eZContentObject::expireAllCache  
 

Sets all content cache files to be expired.

Definition at line ezcontentobject.php.

References eZExpiryHandler::instance().

eZContentObject::expireComplexViewModeCache  
 

Sets all complex viewmode content cache files to be expired.

Definition at line ezcontentobject.php.

References eZExpiryHandler::instance().

& eZContentObject::fetchClassAttributes   version = 0,
  asObject = true
[static]
 

Returns the attributes for the content object version $version and content object $contentObjectID. $language defines the language to fetch.

See also:
attributes

Definition at line ezcontentobject.php.

References version().

Referenced by serialize().

& eZContentObject::fetchDataMap   version = false,
  language = false
 

Returns:
a map with all the content object attributes where the keys are the attribute identifiers.
See also:
eZContentObjectTreeNode::dataMap

Definition at line ezcontentobject.php.

References version().

Referenced by dataMap().

& eZContentObject::fillNodeListAttributes &$    nodeList,
  asObject = true
[static]
 

Fetches the attributes for an array of objects. The objectList parameter contains an array of object id's , versions and language to fetch attributes from.

Definition at line ezcontentobject.php.

References version().

eZContentObject::getVersionCount  
 

Returns number of exist versions.

Definition at line ezcontentobject.php.

References eZDB::instance().

eZContentObject::hasContentAction   name
 

Returns:
true if the content action is in the content action list

Definition at line ezcontentobject.php.

Referenced by contentActionList().

eZContentObject::isCacheExpired   timestamp
 

Returns:
if the content cache timestamp $timestamp is expired.

Definition at line ezcontentobject.php.

References eZExpiryHandler::instance().

eZContentObject::isComplexViewMode   viewMode
 

Returns:
true if the viewmode is a complex viewmode.

Definition at line ezcontentobject.php.

References eZINI::instance().

Referenced by isComplexViewModeCacheExpired().

eZContentObject::isComplexViewModeCacheExpired   viewMode,
  timestamp
 

Returns:
true if the viewmode is a complex viewmode and the viewmode timestamp is expired.

Definition at line ezcontentobject.php.

References isComplexViewMode().

eZContentObject::nextVersion  
 

Returns the next available version number for this object.

Definition at line ezcontentobject.php.

References versions().

Referenced by createNewVersion().

& eZContentObject::owner  
 

Returns the owner of the object as a content object.

Definition at line ezcontentobject.php.

Referenced by attribute().

& eZContentObject::parentNodes   version = false,
  asObject = true
 

Returns:
the parnet nodes for the current object.

Definition at line ezcontentobject.php.

References version().

Referenced by attribute().

& eZContentObject::parents  
 

Returns the parent objects.

Definition at line ezcontentobject.php.

References parents().

Referenced by parents().

eZContentObject::permissions  
 

Returns the permission for the current object.

Definition at line ezcontentobject.php.

eZContentObject::purge   id = false
 

If nodeID is not given, this function will remove object from database. All versions and translations of this object will be lost. Otherwise, it will check node assignment and only delete the object from this node if it was assigned to other nodes as well.

Definition at line ezcontentobject.php.

References eZDB::instance().

& eZContentObject::relatedContentObjectArray   version = false,
  objectID = false
 

Returns the related objects.

Definition at line ezcontentobject.php.

References eZDebugSetting::writeDebug().

Referenced by eZContentObjectVersion::relatedContentObjectArray().

& eZContentObject::relatedContentObjectCount   version = false,
  objectID = false
 

Returns:
the number of related objects

Definition at line ezcontentobject.php.

References eZDebugSetting::writeDebug().

Referenced by attribute().

eZContentObject::remove   id = false,
  nodeID = 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. It uses removeObject to do the real job and passes the object defintion, conditions and extra conditions $extraConditions to this function.

Reimplemented from eZPersistentObject.

Definition at line ezcontentobject.php.

References eZSearch::removeObject().

eZContentObject::removeContentObjectRelation   objectID,
  version = null
 

Removes a link to the given content object id.

Definition at line ezcontentobject.php.

References version().

& eZContentObject::reverseRelatedObjectList   version = false,
  objectID = false
 

Returns objects to which this object is related

Definition at line ezcontentobject.php.

References version().

eZContentObject::revertTo   version
 

Reverts the object to the given version. All versions newer then the given version will be deleted.

Definition at line ezcontentobject.php.

References version().

& eZContentObject::serialize   specificVersion = false
 

Returns:
a DOM structure of the content object and it's attributes.

Definition at line ezcontentobject.php.

References versions().

eZContentObject::setContentObjectAttributes &$    attributes,
  version,
  language
 

Initializes the cached copy of the content object attributes for the given version and language

Definition at line ezcontentobject.php.

References version().

eZContentObject::setPermissions   permissionArray
 

Sets the permissions for this object.

Definition at line ezcontentobject.php.

& eZContentObject::translationList  
 

Returns:
an array with locale objects, these objects represents the languages the content objects are allowed to be translated into.
Note:
the setting ContentSettings/TranslationList in site.ini determines the array.
See also:
translationStringList

Definition at line ezcontentobject.php.

References translationStringList().

Referenced by translationStringList().

eZContentObject::translationStringList  
 

Returns:
an array with locale strings, these strings represents the languages which content objects are allowed to be translated into.
Note:
the setting ContentSettings/TranslationList in site.ini determines the array.
See also:
translationList

Definition at line ezcontentobject.php.

References translationList().

Referenced by translationList().

eZContentObject::version   version,
  asObject = true
 

Returns the given object version. False is returned if the versions does not exist.

Definition at line ezcontentobject.php.

References version().

Referenced by version().

eZContentObject::versions   asObject = true
 

Returns:
an array of versions for the current object.

Definition at line ezcontentobject.php.

References eZPersistentObject::fetchObjectList().

Referenced by serialize().


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

Exponential