eZPublishCommunityProject(LegacyStack)  2013.9
eZContentObject Class Reference
+ Inheritance diagram for eZContentObject:
+ Collaboration diagram for eZContentObject:

Public Member Functions

 __clone ()
 Resets certain attributes of the content object on clone and resets the data map. More...
 
 accessList ($function)
 Get accesslist for specified function. More...
 
 addContentObjectRelation ($toObjectID, $fromObjectVersion=false, $attributeID=0, $relationType=eZContentObject::RELATION_COMMON)
 Adds a link to the given content object id. More...
 
 addLocation ($parentNodeID, $asObject=false)
 Adds a new location (node) to the current object. More...
 
 allContentObjectAttributes ($contentObjectID, $asObject=true, $limit=null)
 Fetches all attributes from any versions of the content object. More...
 
 allLanguages ()
 
 allowedAssignSectionList ()
 
 allowedAssignStateIDList (eZUser $user=null)
 Gets a list of states a user is allowed to put the content object in. More...
 
 allowedAssignStateList (eZUser $user=null)
 
 appendInputRelationList ($addingIDList, $relationType)
 
 assignDefaultStates ()
 Sets the default states of a content object. More...
 
 assignedNodes ($asObject=true, $checkVisibility=false)
 Returns the node assignments for the current object. More...
 
 assignState (eZContentObjectState $state)
 Sets the state of a content object. More...
 
 authorArray ()
 Returns a list of all the authors for this object. More...
 
 availableLanguages ()
 Returns the languages the object has been translated into/exists in. More...
 
 availableLanguagesJsArray ()
 Returns the languages the object has been translated into/exists in as a JSON string. More...
 
 cacheInfo ($Params)
 Returns a structure with information required for caching. More...
 
 canCreate ()
 Returns true if the current user can create a content object like this one. More...
 
 canCreateClassList ($asObject=false, $includeFilter=true, $groupList=false, $fetchID=false)
 
 canCreateLanguages ()
 Returns a list of languages of the current object that the current user can create. More...
 
 canDiff ()
 Returns true if the current user can diff this content object. More...
 
 canEdit ($originalClassID=false, $parentClassID=false, $returnAccessList=false, $language=false)
 Returns true if the current user can edit this content object. More...
 
 canEditLanguages ()
 Returns a list of languages of the current object that the current user can edit. More...
 
 canMoveFrom ()
 Returns true if the current user can move this content object. More...
 
 canPdf ()
 Returns true if the current user can create a pdf of this content object. More...
 
 canRead ()
 Returns true if the current user can read this content object. More...
 
 canRemove ()
 Returns true if the current user can remove this content object. More...
 
 canTranslate ()
 Returns true if the current user can translate this content object. More...
 
 canViewEmbed ()
 Returns true if the node can be viewed as embeded object by the current user. More...
 
 checkAccess ($functionName, $originalClassID=false, $parentClassID=false, $returnAccessList=false, $language=false)
 Check access for the current object. More...
 
 checkGroupLimitationAccess ($limitationValueList, $userID, $contentObjectID=false)
 
 classListFromPolicy ($policy, $allowedLanguageCodes=false)
 
 className ()
 Returns the name of the class which this object was created from. More...
 
 cleanupInternalDrafts ($userID=false, $timeDuration=86400)
 Removes old internal drafts by the specified user associated for the past time span given by $timeDuration. More...
 
 commitInputRelations ($editVersion)
 
 contentActionList ()
 Returns an array of the content actions which can be performed on the current object. More...
 
 contentClass ()
 Returns the content class for the current content object. More...
 
 contentClassGroupIDList ()
 Returns the content class group identifiers for the current content object. More...
 
 contentClassIdentifier ()
 Returns the content class identifer for the current content object. More...
 
 contentObjectAttributes ($asObject=true, $version=false, $language=false, $contentObjectAttributeID=false, $distinctItemsOnly=false)
 Fetches the attributes for the current published version of the object. More...
 
 contentObjectListRelatingThis ($version=false)
 Returns the related objects. More...
 
 copy ($allVersions=true)
 Makes a copy of the object which is stored and then returns it. More...
 
 copyContentObjectRelations ($currentVersion, $newVersion, $newObjectID=false)
 
 copyRevertTo ($version, $language=false)
 Copies the given version of the object and creates a new current version. More...
 
 copyVersion (&$newObject, &$version, $newVersionNumber, $contentObjectID=false, $status=eZContentObjectVersion::STATUS_DRAFT, $languageCode=false, $copyFromLanguageCode=false)
 Creates a new version and returns it as an eZContentObjectVersion object. More...
 
 createInitialVersion ($userID, $initialLanguageCode=false)
 Creates an initial content object version. More...
 
 createNewVersion ($copyFromVersion=false, $versionCheck=true, $languageCode=false, $copyFromLanguageCode=false, $status=eZContentObjectVersion::STATUS_DRAFT)
 Creates a new version and returns it as an eZContentObjectVersion object. More...
 
 createNewVersionIn ($languageCode, $copyFromLanguageCode=false, $copyFromVersion=false, $versionCheck=true, $status=eZContentObjectVersion::STATUS_DRAFT)
 Creates a new version for the language $languageCode. More...
 
 createNodeAssignment ($parentNodeID, $isMain, $remoteID=false, $sortField=eZContentObjectTreeNode::SORT_FIELD_PUBLISHED, $sortOrder=eZContentObjectTreeNode::SORT_ORDER_DESC)
 Creates and returns a new node assignment that will place the object as child of node $nodeID. More...
 
 currentLanguage ()
 Returns the current object's language. More...
 
 currentLanguageObject ()
 Returns the language object of the current object's language. More...
 
 currentVersion ($asObject=true)
 Returns the current version of this document. More...
 
 dataMap ()
 Return a map with all the content object attributes where the keys are the attribute identifiers. More...
 
 embeddedContentObjectCount ($fromObjectVersion=false)
 Returns the xml-embedded objects count. More...
 
 embeddedContentObjectList ($fromObjectVersion=false, $fromObjectID=false)
 Returns the xml-embedded objects. More...
 
 eZContentObject ($row)
 Initializes the object with $row. More...
 
 fetchAttributesByIdentifier ($identifierArray, $version=false, $languageArray=false, $asObject=true)
 Fetches a set of content object attributes by their class identifiers. More...
 
 fetchClassAttributes ($version=0, $asObject=true)
 Returns the attributes for the content object version $version and content object $contentObjectID. More...
 
 fetchDataMap ($version=false, $language=false)
 Returns a map with all the content object attributes where the keys are the attribute identifiers. More...
 
 fetchInput ($contentObjectAttributes, $attributeDataBaseName, $customActionAttributeArray, $customActionParameters)
 
 fixupInput ($contentObjectAttributes, $attributeDataBaseName)
 
 getVersionCount ()
 Returns the number of existing versions. More...
 
 groupedDataMap ()
 Generates a map with all the content object attributes where the keys are the attribute identifiers grouped by class attribute category. More...
 
 handleAllCustomHTTPActions ($attributeDataBaseName, $customActionAttributeArray, $customActionParameters, $objectVersion=false)
 
 handleCustomHTTPActions ($contentObjectAttribute, $attributeDataBaseName, $customActionAttributeArray, $customActionParameters)
 
 hasContentAction ($name)
 Returns true if the given content action is in the content action list. More...
 
 hasRemainingVersions ()
 Returns true if the object has any versions remaining. More...
 
 hasVisibleNode ()
 Returns whether the current object has at least one visible node. More...
 
 initialLanguage ()
 Returns the current object's initial language object, or false if not set. More...
 
 initialLanguageCode ()
 Returns the current object's initial language code, or false if not set. More...
 
 isAlwaysAvailable ()
 
 languages ()
 
 linkedContentObjectCount ($fromObjectVersion=false)
 Returns the xml-linked objects count. More...
 
 linkedContentObjectList ($fromObjectVersion=false, $fromObjectID=false)
 Returns the xml-linked objects. More...
 
 mainNode ()
 Returns the main node id for the current object. More...
 
 mainNodeID ()
 Returns the main node id for the current object and sets the attribute MainNodeID in the current object. More...
 
 mainParentNodeID ()
 Returns the ID of the the current object's main node. More...
 
 matchIngroupIDList ()
 Get class groups this object's class belongs to if match for class groups is enabled, otherwise false. More...
 
 name ($version=false, $lang=false)
 Returns an object's name for the version given by $version in the language given by $lang. More...
 
 names ()
 Returns all translations of the current object's name. More...
 
 nextVersion ()
 Returns the next available version number for this object. More...
 
 owner ()
 Returns the owner of the object as a content object. More...
 
 parentNodeIDArray ()
 Returns an array of parent node IDs. More...
 
 parentNodes ($version=false, $asObject=true)
 Returns the parent nodes for the current object. More...
 
 permissions ()
 Returns the permission for the current object. More...
 
 postUnserialize ($package)
 Performs additional unserialization actions that need to be performed when all objects contained in the package are already installed. More...
 
 previousVersion ()
 Returns the previous available version number for this object, if existing, false otherwise ( if the object has only one version ) More...
 
 purge ()
 Deletes the current object, all versions and translations, and corresponding tree nodes from the database. More...
 
 relatedContentObjectArray ($fromObjectVersion=false, $fromObjectID=false, $attributeID=0, $params=false)
 Left for compatibility. More...
 
 relatedContentObjectCount ($fromObjectVersion=false, $attributeID=0, $params=false)
 Returns the number of related objects. More...
 
 relatedContentObjectList ($fromObjectVersion=false, $fromObjectID=false, $attributeID=0, $groupByAttribute=false, $params=false)
 Returns related objects. More...
 
 relatedObjectCount ($version=false, $attributeID=0, $reverseRelatedObjects=false, $params=false)
 Fetch the number of (reverse) related objects. More...
 
 relatedObjects ($fromObjectVersion=false, $objectID=false, $attributeID=0, $groupByAttribute=false, $params=false, $reverseRelatedObjects=false)
 Returns related or reverse related objects. More...
 
 remoteID ()
 Returns the remote id of the current content object. More...
 
 removeContentObjectRelation ($toObjectID=false, $fromObjectVersion=false, $attributeID=0, $relationType=eZContentObject::RELATION_COMMON)
 Removes a link to the given content object id. More...
 
 removeThis ($nodeID=null)
 Archives the current object and removes assigned nodes. More...
 
 removeTranslation ($languageID)
 Removes a translation from the current object. More...
 
 rename ($newName)
 Sets the object's name to $newName: tries to find attributes that are in 'object pattern name' and updates them. More...
 
 resetDataMap ()
 Resets (empties) the current object's data map. More...
 
 resetInputRelationList ()
 Resets the object's input relation list. More...
 
 restoreObjectAttributes ()
 Restores attributes for current content object when it's being restored from trash. More...
 
 reverseEmbeddedObjectCount ($fromObjectVersion=false)
 Returns the reverse xml-embedded objects count. More...
 
 reverseEmbeddedObjectList ($fromObjectVersion=false, $fromObjectID=false)
 Returns the reverse xml-embedded objects. More...
 
 reverseLinkedObjectCount ($fromObjectVersion=false)
 Returns the reverse xml-linked objects count. More...
 
 reverseLinkedObjectList ($fromObjectVersion=false, $fromObjectID=false)
 Returns the reverse xml-linked objects. More...
 
 reverseRelatedObjectCount ($version=false, $attributeID=0, $params=false)
 Returns the number of objects to which this object is related. More...
 
 reverseRelatedObjectList ($version=false, $attributeID=0, $groupByAttribute=false, $params=false)
 Returns the objects to which this object are related . More...
 
 sectionIdentifier ()
 Returns object's section identifier. More...
 
 serialize ($package, $specificVersion=false, $options=false, $contentNodeIDArray=false, $topNodeIDArray=false)
 Returns a DOM structure of the content object and it's attributes. More...
 
 setAlwaysAvailableLanguageID ($languageID, $version=false)
 
 setCachedName ($name)
 Sets the name of the object, in memory only. More...
 
 setClassName ($name)
 
 setContentObjectAttributes (&$attributes, $version, $language)
 Initializes the cached copy of the content object attributes for the given version and language. More...
 
 setCurrentLanguage ($lang)
 Sets the current object's language and resets the name. More...
 
 setName ($objectName, $versionNum=false, $languageCode=false)
 Sets the name of the object in all translations. More...
 
 setPermissions ($permissionArray)
 Sets the permissions for this object. More...
 
 stateIDArray ($refreshCache=false)
 Gets the current states of the content object. More...
 
 stateIdentifierArray ()
 
 store ($fieldFilters=null)
 Stores the object. More...
 
 storeInput ($contentObjectAttributes, $attributeInputMap)
 Transaction unsafe. More...
 
 storeNodeModified ()
 Update all nodes to set modified_subnode value. More...
 
 validateInput ($contentObjectAttributes, $attributeDataBaseName, $inputParameters=false, $parameters=array())
 
 version ($version, $asObject=true)
 Returns the given object version. More...
 
 versionLanguageName ($version, $lang=false)
 Returns the object name for version $version in the language $lang. More...
 
 versions ($asObject=true, $parameters=array())
 Returns an array of eZContentObjectVersion for the current object according to the conditions in $parameters. More...
 
 visibleNodes ()
 Returns the visible nodes of the current object. More...
 
- 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 cleanupAllInternalDrafts ($userID=false, $timeDuration=86400)
 Removes all old internal drafts by the specified user for the past time span given by $timeDuration. More...
 
static clearCache ($idArray=array())
 Clear in-memory caches. More...
 
static create ($name, $contentclassID, $userID, $sectionID=1, $version=1, $languageCode=false)
 Creates a new content object instance and stores it. More...
 
static createFetchSQLString ($id)
 Creates the SQL for fetching the object with ID $id and returns the string. More...
 
static createFilterByVisibilitySQLString ($IgnoreVisibility=false, $ezcontentobjectTable= 'ezcontentobject')
 Creates the SQL for filtering objects by visibility, used by IgnoreVisibility on some fetches. More...
 
static createGroupedDataMap ($contentObjectAttributes)
 Generates a map with all the content object attributes where the keys are the attribute identifiers grouped by class attribute category. More...
 
static createWithNodeAssignment ($parentNode, $contentClassID, $languageCode, $remoteID=false)
 Creates object with nodeAssignment from given parent Node, class ID and language code. More...
 
static defaultLanguage ()
 
static definition ()
 
static exists ($id)
 Returns true, if a content object with the ID $id exists, false otherwise. More...
 
static expireAllCache ()
 Sets all content cache files to be expired. More...
 
static expireAllViewCache ()
 Sets all view cache files to be expired. More...
 
static expireComplexViewModeCache ()
 Sets all complex viewmode content cache files to be expired. More...
 
static expireTemplateBlockCache ()
 Expires all template block cache. More...
 
static fetch ($id, $asObject=true)
 Fetches a content object by ID. More...
 
static fetchByNodeID ($nodeID, $asObject=true)
 Fetches the contentobject which has a node with ID $nodeID. More...
 
static fetchByRemoteID ($remoteID, $asObject=true)
 Returns a contentobject by remote ID. More...
 
static fetchFilteredList ($conditions=null, $offset=false, $limit=false, $asObject=true)
 Returns a filtered array of content objects. More...
 
static fetchIDArray ($idArray, $asObject=true, $lang=false)
 Fetches a content object list based on an array of content object ids. More...
 
static fetchList ($asObject=true, $conditions=null, $offset=false, $limit=false)
 Returns an array of content objects. More...
 
static fetchListCount ($conditions=null)
 Returns the number of objects in the database. More...
 
static fetchObjectCountByUserID ($classID, $userID, $status=false)
 Returns the number of objects of the given class is created by the given user. More...
 
static fetchSameClassList ($contentClassID, $asObject=true, $offset=false, $limit=false)
 Returns an array of content objects with the content class id $contentClassID. More...
 
static fetchSameClassListCount ($contentClassID)
 Returns the number of content objects with the content class id $contentClassID. More...
 
static fillNodeListAttributes ($objList, $asObject=true)
 Fetches the attributes for an array of objects or nodes. More...
 
static fixReverseRelations ($objectID, $mode=false)
 Fixes reverse relations. More...
 
static isCacheExpired ($timestamp)
 Returns true if the content cache timestamp $timestamp is expired. More...
 
static isComplexViewMode ($viewMode)
 Returns true if the viewmode is a complex viewmode. More...
 
static isComplexViewModeCacheExpired ($viewMode, $timestamp)
 Returns true if the viewmode is a complex viewmode and the viewmode timestamp is expired. More...
 
static isObjectRelationTyped ()
 
static mapLanguage ($language, $options)
 Maps input lange to another one if defined in $options['language_map']. More...
 
static recursionProtect ($id)
 
static recursionProtectionEnd ()
 
static recursionProtectionStart ()
 
static relationTypeMask ($allRelations=false)
 
static removeVersions ($versionStatus=false)
 
static setDefaultLanguage ($lang)
 Set default language. More...
 
static translationList ()
 Returns an array with locale objects, these objects represents the languages the content objects are allowed to be translated into. More...
 
static translationStringList ()
 Returns an array with locale strings, these strings represents the languages which content objects are allowed to be translated into. More...
 
- 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

 $ClassIdentifier
 
 $ClassName
 
 $ContentActionList = false
 
 $ContentObjectAttributes = array()
 
 $CurrentLanguage
 
 $DataMap = array()
 
 $ID
 
 $InputRelationList = array()
 
 $MainNodeID = false
 
 $Name
 
const PACKAGE_DELETE = 4
 
const PACKAGE_ERROR_EXISTS = 2
 
const PACKAGE_ERROR_HAS_CHILDREN = 102
 
const PACKAGE_ERROR_MODIFIED = 101
 
const PACKAGE_ERROR_NO_CLASS = 1
 
const PACKAGE_ERROR_NODE_EXISTS = 3
 
const PACKAGE_KEEP = 5
 
const PACKAGE_NEW = 3
 
const PACKAGE_REPLACE = 1
 
const PACKAGE_SKIP = 2
 
const PACKAGE_UPDATE = 6
 
const RELATION_ATTRIBUTE = 8
 
const RELATION_COMMON = 1
 
const RELATION_EMBED = 2
 
const RELATION_LINK = 4
 
const STATUS_ARCHIVED = 2
 
const STATUS_DRAFT = 0
 
const STATUS_PUBLISHED = 1
 
- Public Attributes inherited from eZPersistentObject
 $PersistentDataDirty
 

Private Attributes

 $StateIDArray = false
 

Member Function Documentation

eZContentObject::__clone ( )

Resets certain attributes of the content object on clone and resets the data map.

eZContentObject::accessList (   $function)

Get accesslist for specified function.

Parameters
string$function
Returns
array|int
eZContentObject::addContentObjectRelation (   $toObjectID,
  $fromObjectVersion = false,
  $attributeID = 0,
  $relationType = eZContentObject::RELATION_COMMON 
)

Adds a link to the given content object id.

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
int$toObjectID
int | bool$fromObjectVersion
int$attributeID
int$relationType
Returns
bool|void

Referenced by commitInputRelations().

eZContentObject::addLocation (   $parentNodeID,
  $asObject = false 
)

Adds a new location (node) to the current object.

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
int$parentNodeIDThe id of the node to use as parent.
bool$asObjectIf true it will return the new child-node as an object, if not it returns the ID.
Returns
eZContentObjectTreeNode|int
eZContentObject::allContentObjectAttributes (   $contentObjectID,
  $asObject = true,
  $limit = null 
)

Fetches all attributes from any versions of the content object.

Parameters
int$contentObjectID
bool$asObject
array | null$limitthe limit array passed to {
See Also
eZPersistentObject::fetchObjectList}
Returns
eZContentObjectAttribute[]|array|null

Referenced by purge(), and restoreObjectAttributes().

eZContentObject::allLanguages ( )
Returns
eZContentLanguage[]|array
eZContentObject::allowedAssignSectionList ( )
Returns
eZSection[]|null
eZContentObject::allowedAssignStateIDList ( eZUser  $user = null)

Gets a list of states a user is allowed to put the content object in.

Returns
array the IDs of all states we are allowed to set
Parameters
eZUser$userthe user to check the policies of, when omitted the currently logged in user will be used

Referenced by allowedAssignStateList().

eZContentObject::allowedAssignStateList ( eZUser  $user = null)
Parameters
eZUser | null$user
Returns
array
eZContentObject::appendInputRelationList (   $addingIDList,
  $relationType 
)
Parameters
int[]$addingIDList
int$relationType

Referenced by restoreXmlRelations().

eZContentObject::assignDefaultStates ( )

Sets the default states of a content object.

This function is called upon instantiating a content object with eZContentClass::instantiate(), so should normally not be called by any other code.

eZContentObject::assignedNodes (   $asObject = true,
  $checkVisibility = false 
)

Returns the node assignments for the current object.

Parameters
boolean$asObject
boolean$checkVisibilityif true, the visibility and the setting site.ini/[SiteAccessSettings]/ShowHiddenNodes are taken into account.
Returns
eZContentObjectTreeNode[]|array[]

Referenced by copy(), createNewVersion(), removeTranslation(), storeNodeModified(), and visibleNodes().

eZContentObject::assignState ( eZContentObjectState  $state)

Sets the state of a content object.

Changes are stored immediately in the database, does not require a store() of the content object. Should only be called on instances of eZContentObject that have a ID (that were stored already before).

Parameters
eZContentObjectState$state
Returns
boolean true when the state was set, false if the state equals the current state
eZContentObject::authorArray ( )

Returns a list of all the authors for this object.

Returns
eZUser[]
eZContentObject::availableLanguages ( )

Returns the languages the object has been translated into/exists in.

Returns
array An array with the language codes.

Referenced by canCreateLanguages(), canEditLanguages(), copyVersion(), and ezpContentFieldSet\fromContentObject().

eZContentObject::availableLanguagesJsArray ( )

Returns the languages the object has been translated into/exists in as a JSON string.

Returns
bool|string
eZContentObject::cacheInfo (   $Params)

Returns a structure with information required for caching.

Parameters
$Paramsarray
Returns
array
eZContentObject::canCreate ( )

Returns true if the current user can create a content object like this one.

Returns
bool
eZContentObject::canCreateClassList (   $asObject = false,
  $includeFilter = true,
  $groupList = false,
  $fetchID = false 
)

Finds all classes that the current user can create objects from and returns. It is also possible to filter the list event more with $includeFilter and $groupList.

Parameters
$asObjectIf true then it return eZContentClass objects, if not it will be an associative array with name and id keys.
$includeFilterIf true then it will include only from class groups defined in $groupList, if not it will exclude those groups.
$groupListAn array with class group IDs that should be used in filtering, use false if you do not wish to filter at all.
$fetchIDA unique name for the current fetch, this must be supplied when filtering is used if you want caching to work.
eZContentObject::canCreateLanguages ( )

Returns a list of languages of the current object that the current user can create.

Returns
eZContentLanguage[]
eZContentObject::canDiff ( )

Returns true if the current user can diff this content object.

Returns
bool
eZContentObject::canEdit (   $originalClassID = false,
  $parentClassID = false,
  $returnAccessList = false,
  $language = false 
)

Returns true if the current user can edit this content object.

Parameters
int | bool$originalClassID
int | bool$parentClassID
bool$returnAccessList
string | bool$language
Returns
bool

Referenced by canEditLanguages().

eZContentObject::canEditLanguages ( )

Returns a list of languages of the current object that the current user can edit.

Returns
eZContentLanguage[]
eZContentObject::canMoveFrom ( )

Returns true if the current user can move this content object.

Returns
bool
eZContentObject::canPdf ( )

Returns true if the current user can create a pdf of this content object.

Returns
bool
eZContentObject::canRead ( )

Returns true if the current user can read this content object.

Returns
bool
eZContentObject::canRemove ( )

Returns true if the current user can remove this content object.

Returns
bool
eZContentObject::canTranslate ( )

Returns true if the current user can translate this content object.

Returns
bool
eZContentObject::canViewEmbed ( )

Returns true if the node can be viewed as embeded object by the current user.

Returns
bool
eZContentObject::checkAccess (   $functionName,
  $originalClassID = false,
  $parentClassID = false,
  $returnAccessList = false,
  $language = false 
)

Check access for the current object.

Parameters
string$functionNameFunction name ( edit, read, remove, etc. )
int | bool$originalClassIDUsed to check access for object creation
int | bool$parentClassIDUsed to check access for object creation
bool$returnAccessListIf true, returns access list instead of access result
string | bool$language
Returns
array|int 1 if has access, 0 if not, array if $returnAccessList is true

Referenced by accessList(), canCreate(), canCreateLanguages(), canDiff(), canEdit(), canMoveFrom(), canPdf(), canRead(), canRemove(), canTranslate(), canViewEmbed(), and removeTranslation().

eZContentObject::checkGroupLimitationAccess (   $limitationValueList,
  $userID,
  $contentObjectID = false 
)
Parameters
array$limitationValueList
int$userID
int | bool$contentObjectID
Returns
string Returns "denied" or "allowed"

Referenced by allowedAssignStateIDList(), checkAccess(), and classListFromPolicy().

eZContentObject::classListFromPolicy (   $policy,
  $allowedLanguageCodes = false 
)

Referenced by canCreateClassList().

eZContentObject::className ( )

Returns the name of the class which this object was created from.

The object will cache the class name information so multiple calls will be fast.

Returns
string|bool|null
static eZContentObject::cleanupAllInternalDrafts (   $userID = false,
  $timeDuration = 86400 
)
static

Removes all old internal drafts by the specified user for the past time span given by $timeDuration.

Parameters
int | bool$userIDThe ID of the user to cleanup for, if false it will use the current user.
int$timeDurationdefault time duration for internal drafts 60*60*24 seconds (1 day)
eZContentObject::cleanupInternalDrafts (   $userID = false,
  $timeDuration = 86400 
)

Removes old internal drafts by the specified user associated for the past time span given by $timeDuration.

Parameters
int | bool$userIDThe ID of the user to cleanup for, if false it will use the current user.
int$timeDurationdefault time duration for internal drafts 60*60*24 seconds (1 day)
static eZContentObject::clearCache (   $idArray = array())
static
eZContentObject::commitInputRelations (   $editVersion)
Parameters
int | bool$editVersion
Returns
bool

Referenced by restoreXmlRelations(), and validateInput().

eZContentObject::contentActionList ( )

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

Returns
array|bool
eZContentObject::contentClass ( )

Returns the content class for the current content object.

Returns
eZContentClass|null

Referenced by contentClassGroupIDList(), copyVersion(), matchIngroupIDList(), and rename().

eZContentObject::contentClassGroupIDList ( )

Returns the content class group identifiers for the current content object.

Returns
array
eZContentObject::contentClassIdentifier ( )

Returns the content class identifer for the current content object.

The object will cache the class name information so multiple calls will be fast.

Returns
string|bool|null
eZContentObject::contentObjectAttributes (   $asObject = true,
  $version = false,
  $language = false,
  $contentObjectAttributeID = false,
  $distinctItemsOnly = false 
)

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

Todo:

fix using of $asObject parameter

fix condition for getting attribute from cache

probably need to move method to eZContentObjectVersion class

Parameters
bool$asObject
int | bool$version
string | bool$language
int | bool$contentObjectAttributeID
bool$distinctItemsOnly
Returns
eZContentObjectAttribute[]|array

Referenced by contentActionList(), fetchDataMap(), and handleAllCustomHTTPActions().

eZContentObject::contentObjectListRelatingThis (   $version = false)

Returns the related objects.

See Also
reverseRelatedObjectList()
Deprecated:
This function is a duplicate of reverseRelatedObjectList(), use that function instead.
Parameters
int | bool$version
Returns
array|eZContentObject[]
eZContentObject::copy (   $allVersions = true)

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

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
bool$allVersionsIf true, all versions are copied. If false, only the latest version is copied
Returns
eZContentObject
eZContentObject::copyContentObjectRelations (   $currentVersion,
  $newVersion,
  $newObjectID = false 
)
Parameters
int$currentVersion
int$newVersion
int | bool$newObjectID

Referenced by copyVersion().

eZContentObject::copyRevertTo (   $version,
  $language = false 
)

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

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
int$version
string | bool$language
Returns
int The new version number
eZContentObject::copyVersion ( $newObject,
$version,
  $newVersionNumber,
  $contentObjectID = false,
  $status = eZContentObjectVersion::STATUS_DRAFT,
  $languageCode = false,
  $copyFromLanguageCode = 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.

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
eZContentObject$newObject
eZContentObjectVersion$version
int$newVersionNumber
int | bool$contentObjectID
int$status
string | bool$languageCodeIf false all languages will be copied, otherwise only specified by the locale code string or an array of the locale code strings.
string | bool$copyFromLanguageCode
Returns
eZContentObjectVersion

Referenced by copy(), and createNewVersion().

static eZContentObject::create (   $name,
  $contentclassID,
  $userID,
  $sectionID = 1,
  $version = 1,
  $languageCode = false 
)
static

Creates a new content object instance and stores it.

Parameters
string$name
int$contentclassID
int$userID
int$sectionID
int$version
string | bool$languageCode
Returns
eZContentObject

Referenced by eZContentClass\instantiate().

static eZContentObject::createFetchSQLString (   $id)
static

Creates the SQL for fetching the object with ID $id and returns the string.

Parameters
int$id
Returns
string

Referenced by exists(), and fetch().

static eZContentObject::createFilterByVisibilitySQLString (   $IgnoreVisibility = false,
  $ezcontentobjectTable = 'ezcontentobject' 
)
static

Creates the SQL for filtering objects by visibility, used by IgnoreVisibility on some fetches.

The object is visible if 1 or more assigned nodes are visible.

Since
Version 4.1
Parameters
bool$IgnoreVisibilityignores visibility if true
string$ezcontentobjectTablename of ezcontentobject table used in sql
Returns
string with sql condition for node filtering by visibility
static eZContentObject::createGroupedDataMap (   $contentObjectAttributes)
static

Generates a map with all the content object attributes where the keys are the attribute identifiers grouped by class attribute category.

Result is not cached, so make sure you don't call this over and over.

Parameters
eZContentObjectAttribute[]$contentObjectAttributes Array of eZContentObjectAttribute objects
Returns
array
eZContentObject::createInitialVersion (   $userID,
  $initialLanguageCode = false 
)

Creates an initial content object version.

Parameters
int$userID
string | bool$initialLanguageCode
Returns
eZContentObjectVersion
eZContentObject::createNewVersion (   $copyFromVersion = false,
  $versionCheck = true,
  $languageCode = false,
  $copyFromLanguageCode = false,
  $status = eZContentObjectVersion::STATUS_DRAFT 
)

Creates a new version and returns it as an eZContentObjectVersion object.

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
int | bool$copyFromVersionIf given, that version is used to create a copy.
bool$versionCheckIf true it will check if there are too many version and remove some of them to make room for a new.
string | bool$languageCode
string | bool$copyFromLanguageCode
int$status
Returns
eZContentObjectVersion

Referenced by createNewVersionIn(), rename(), and eZContentFunctions\updateAndPublishObject().

eZContentObject::createNewVersionIn (   $languageCode,
  $copyFromLanguageCode = false,
  $copyFromVersion = false,
  $versionCheck = true,
  $status = eZContentObjectVersion::STATUS_DRAFT 
)

Creates a new version for the language $languageCode.

Parameters
string$languageCode
bool$copyFromLanguageCode
int | bool$copyFromVersion
bool$versionCheck
int$status
Returns
eZContentObjectVersion

Referenced by copyRevertTo().

eZContentObject::createNodeAssignment (   $parentNodeID,
  $isMain,
  $remoteID = false,
  $sortField = eZContentObjectTreeNode::SORT_FIELD_PUBLISHED,
  $sortOrder = eZContentObjectTreeNode::SORT_ORDER_DESC 
)

Creates and returns a new node assignment that will place the object as child of node $nodeID.

The returned assignment will already be stored in the database

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
int$parentNodeIDThe node ID of the parent node
bool$isMainTrue if the created node is the main node of the object
string | bool$remoteIDA string denoting the unique remote ID of the assignment or false for no remote id.
int$sortField
int$sortOrder
Returns
eZNodeAssignment|null
static eZContentObject::createWithNodeAssignment (   $parentNode,
  $contentClassID,
  $languageCode,
  $remoteID = false 
)
static

Creates object with nodeAssignment from given parent Node, class ID and language code.

Parameters
eZContentObjectTreeNode$parentNode
int$contentClassID
string$languageCode
string | bool$remoteID
Returns
eZContentObject|null

Referenced by eZWebDAVContentBackend\createFolder().

eZContentObject::currentLanguage ( )

Returns the current object's language.

Returns
bool|string
eZContentObject::currentLanguageObject ( )

Returns the language object of the current object's language.

Returns
eZContentLanguage|bool|
eZContentObject::currentVersion (   $asObject = true)

Returns the current version of this document.

Parameters
bool$asObjectIf true, returns an eZContentObjectVersion; if false, returns an array
Returns
eZContentObjectVersion|array|bool

Referenced by copy(), createNewVersion(), removeTranslation(), restoreXmlRelations(), serialize(), and setAlwaysAvailableLanguageID().

eZContentObject::dataMap ( )

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

Returns
eZContentObjectAttribute[]
eZContentObject::embeddedContentObjectCount (   $fromObjectVersion = false)

Returns the xml-embedded objects count.

See Also
relatedObjectCount()
Parameters
int | bool$fromObjectVersion
Returns
int
eZContentObject::embeddedContentObjectList (   $fromObjectVersion = false,
  $fromObjectID = false 
)

Returns the xml-embedded objects.

See Also
relatedObjects()
Parameters
int | bool$fromObjectVersion
int | bool$fromObjectID
Returns
array|eZContentObject[]
static eZContentObject::exists (   $id)
static

Returns true, if a content object with the ID $id exists, false otherwise.

Parameters
int$id
Returns
bool
static eZContentObject::expireAllCache ( )
static

Sets all content cache files to be expired.

Both view cache and cache blocks are expired.

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.

Note: This is considered a internal function, instead use {

See Also
eZContentCacheManager::clearAllContentCache}

Referenced by eZContentCacheManager\clearAllContentCache().

static eZContentObject::expireAllViewCache ( )
static
static eZContentObject::expireComplexViewModeCache ( )
static

Sets all complex viewmode content cache files to be expired.

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 eZContentCacheManager\clearObjectViewCache(), and eZContentCacheManager\clearObjectViewCacheArray().

static eZContentObject::expireTemplateBlockCache ( )
static

Expires all template block cache.

This should be expired anytime any content is published/modified or removed.

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 eZContentCacheManager\clearTemplateBlockCache().

eZContentObject::eZContentObject (   $row)

Initializes the object with $row.

If $row is an integer, it will try to fetch it from the database using it as the unique ID.

Parameters
int | array$row

Referenced by create(), fetch(), fetchIDArray(), and relatedObjects().

static eZContentObject::fetch (   $id,
  $asObject = true 
)
static

Fetches a content object by ID.

Parameters
int$idID of the content object to fetch
bool$asObjectReturn the result as an object (true) or an assoc. array (false)
Returns
eZContentObject

Referenced by eZContentOperationCollection\addAssignment(), eZContentObjectTreeNode\addChildTo(), eZShopOperationCollection\addToBasket(), eZObjectRelationListType\appendObject(), eZRole\assignToUser(), eZContentOperationCollection\attributePublishAction(), eZContentOperationCollection\changeTranslationAvailableStatus(), checkGroupLimitationAccess(), eZContentCacheManager\clearTemplateBlockCache(), eZWorkflowProcess\content(), eZInformationCollectionAttribute\contentObject(), eZProductCollectionItem\contentObject(), eZContentObjectVersion\contentObject(), eZUser\contentObject(), copyPublishContentObject(), eZContentOperationCollection\copyTranslations(), eZContentObjectVersion\creator(), eZContentObjectTreeNode\creator(), eZObjectRelationListType\customObjectAttributeHTTPAction(), updateNodeAssignment\execute(), eZFinishUserRegisterType\execute(), eZWaitUntilDateType\execute(), eZApproveType\execute(), eZMultiplexerType\execute(), eZShopFunctionCollection\fetchBestSellList(), fetchByRemoteID(), eZContentFunctionCollection\fetchContentObject(), eZApproveType\fetchHTTPInput(), eZContentFunctionCollection\fetchObject(), eZURLObjectLink\fetchObjectVersionList(), eZContentFunctionCollection\fetchRelatedObjects(), eZContentFunctionCollection\fetchRelatedObjectsCount(), eZShopFunctionCollection\fetchRelatedPurchaseList(), eZContentFunctionCollection\fetchReverseRelatedObjects(), eZContentFunctionCollection\fetchReverseRelatedObjectsCount(), eZRole\fetchRolesByLimitation(), eZRole\fetchUserByRole(), ezpContent\fromObjectId(), eZObjectRelationType\fromString(), eZObjectRelationListType\fromString(), eZRSSExport\generateFeed(), eZContentObjectPackageHandler\generateFetchAliasArray(), eZContentCacheManager\generateObjectViewCache(), eZObjectRelationListType\handleCustomObjectHTTPActions(), importRSSItem(), eZImageAliasHandler\initializeFromFile(), eZObjectRelationListType\initializeObjectAttribute(), eZContentObjectPackageHandler\installSuspendedNodeAssignment(), eZTextFileUser\loginUser(), eZContentOperationCollection\loopNodeAssignment(), eZObjectRelationListType\metaData(), eZOrderStatusHistory\modifier(), eZContentCacheManager\nodeList(), eZContentCacheManager\nodeListForObject(), eZContentObjectAttribute\object(), eZInformationCollection\object(), eZContentObjectTreeNode\object(), eZObjectRelationType\objectAttributeContent(), eZObjectRelationListType\onPublish(), owner(), eZCollaborationItemParticipantLink\participant(), eZOrder\productList(), eZContentOperationCollection\publishNode(), eZContentUpload\publishObject(), eZLDAPUser\publishUpdateUser(), eZUserOperationCollection\publishUserContentObject(), eZContentOperationCollection\registerSearchObject(), eZContentObjectOperations\remove(), eZObjectRelationType\removeContentObjectRelation(), eZContentOperationCollection\removeNodes(), eZContentOperationCollection\removeOldNodes(), eZContentOperationCollection\removeTemporaryDrafts(), eZContentOperationCollection\removeTranslation(), eZSiteInstaller\renameContentObject(), eZContentOperationCollection\resetNodeassignmentOpcodes(), eZUserOperationCollection\sendActivationEmail(), eZObjectRelationType\serializeContentObjectAttribute(), eZObjectRelationListType\serializeContentObjectAttribute(), eZContentOperationCollection\setObjectStatusPublished(), eZContentOperationCollection\setVersionStatus(), eZObjectRelationType\storeObjectAttribute(), eZObjectRelationListType\storeObjectAttribute(), eZObjectRelationListType\title(), eZXMLTextType\transformLinksToRemoteLinks(), eZContentOperationCollection\updateAlwaysAvailable(), eZSiteInstaller\updateContentObjectAttributes(), eZContentOperationCollection\updateInitialLanguage(), eZContentObjectTreeNode\updateMainNodeID(), eZContentOperationCollection\updateNontranslatableAttributes(), eZSiteInstaller\updateObjectAttributeFromString(), eZContentOperationCollection\updateObjectState(), eZContentOperationCollection\updateSectionID(), eZApproveType\validateGroupIDList(), eZObjectRelationListType\validateObjectAttributeHTTPInput(), and eZApproveType\validateUserIDList().

eZContentObject::fetchAttributesByIdentifier (   $identifierArray,
  $version = false,
  $languageArray = false,
  $asObject = true 
)

Fetches a set of content object attributes by their class identifiers.

Parameters
string[]$identifierArray
int | bool$version
string[]|bool$languageArray
bool$asObjectIf true, returns an array of eZContentObjectAttributes, a normal array otherwise
Returns
eZContentObjectAttribute[]|array|null

Referenced by restoreXmlRelations().

static eZContentObject::fetchByNodeID (   $nodeID,
  $asObject = true 
)
static

Fetches the contentobject which has a node with ID $nodeID.

$nodeID can also be an array of NodeIDs. In this case, an array of content objects will be returned

Parameters
int | array$nodeIDSingle nodeID or array of NodeIDs
bool$asObjectIf results have to be returned as eZContentObject instances or not
Returns
eZContentObject|eZContentObject[]|array|null Content object or array of content objects. Content objects can be eZContentObject instances or array result sets

Referenced by eZMultiplexerType\execute(), eZURLAliasML\fetchPathByActionList(), eZNodeAssignment\getParentObject(), getRelatedObjectList(), eZXMLTextType\getRelatedObjectList(), eZContentCacheManager\nodeListForObject(), and eZContentObjectTreeNode\updateMainNodeID().

eZContentObject::fetchClassAttributes (   $version = 0,
  $asObject = true 
)

Returns the attributes for the content object version $version and content object $contentObjectID.

Parameters
int$version
bool$asObject
Returns
eZContentClassAttribute[]|array|null

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.

Parameters
int | bool$version
string | bool$language
Returns
eZContentObjectAttribute[]

Referenced by dataMap(), fetchInput(), ezpContentFieldSet\fromContentObject(), and groupedDataMap().

static eZContentObject::fetchFilteredList (   $conditions = null,
  $offset = false,
  $limit = false,
  $asObject = true 
)
static

Returns a filtered array of content objects.

Parameters
array | null$conditionsOptional conditions to limit the fetch
int | bool$offsetWhere to start fetch from, set to false to skip it.
int | bool$limitMaximum number of objects to fetch, set false to skip it.
bool$asObjectWhether to return objects or not
Returns
array|eZPersistentObject[]|null

Referenced by fetchSameClassList().

static eZContentObject::fetchIDArray (   $idArray,
  $asObject = true,
  $lang = false 
)
static

Fetches a content object list based on an array of content object ids.

Parameters
array$idArrayarray of content object ids
bool$asObjectWether to get the result as an array of eZContentObject or an array of associative arrays
bool | string$langA language code to put at the top of the prioritized languages list.
Returns
array(contentObjectID => eZContentObject|array) array of eZContentObject (if $asObject = true) or array of associative arrays (if $asObject = false)

Referenced by eZContentCacheManager\clearTemplateBlockCache(), and eZXMLOutputHandler\prefetch().

eZContentObject::fetchInput (   $contentObjectAttributes,
  $attributeDataBaseName,
  $customActionAttributeArray,
  $customActionParameters 
)
Parameters
eZContentObjectAttribute[]$contentObjectAttributes
string$attributeDataBaseName
array$customActionAttributeArray
array$customActionParameters
Returns
array
static eZContentObject::fetchList (   $asObject = true,
  $conditions = null,
  $offset = false,
  $limit = false 
)
static

Returns an array of content objects.

Parameters
bool$asObjectWhether to return objects or not
array | null$conditionsOptional conditions to limit the fetch
int | bool$offsetWhere to start fetch from, set to false to skip it.
int | bool$limitMaximum number of objects to fetch, set false to skip it.
Returns
eZContentObject[]|array|null

Referenced by eZContentCacheManager\clearContentCacheIfNeededBySectionID(), eZSiteInstaller\contentObjectByName(), and eZOrder\orderStatistics().

static eZContentObject::fetchListCount (   $conditions = null)
static

Returns the number of objects in the database.

Optionally $conditions can be used to limit the list count.

Parameters
array | null$conditions
Returns
int
static eZContentObject::fetchObjectCountByUserID (   $classID,
  $userID,
  $status = false 
)
static

Returns the number of objects of the given class is created by the given user.

Parameters
int$classID
int$userID
int | bool$status
Returns
int

Referenced by eZContentFunctionCollection\fetchObjectCountByUserID().

static eZContentObject::fetchSameClassList (   $contentClassID,
  $asObject = true,
  $offset = false,
  $limit = false 
)
static

Returns an array of content objects with the content class id $contentClassID.

Parameters
int$contentClassID
bool$asObjectWhether to return objects or not
int | bool$offsetWhere to start fetch from, set to false to skip it.
int | bool$limitMaximum number of objects to fetch, set false to skip it.
Returns
eZContentObject[]|array|null

Referenced by eZSiteInstaller\addClassAttributes(), eZContentClassAttribute\initializeObjectAttributes(), eZContentClass\objectList(), and eZContentClassOperations\remove().

static eZContentObject::fetchSameClassListCount (   $contentClassID)
static

Returns the number of content objects with the content class id $contentClassID.

Parameters
int$contentClassID
Returns
int

Referenced by eZContentClassPackageHandler\install(), and eZContentClassPackageHandler\uninstall().

static eZContentObject::fillNodeListAttributes (   $objList,
  $asObject = true 
)
static

Fetches the attributes for an array of objects or nodes.

Parameters
eZContentObject[]|eZContentObjectTreeNode[]$objList
bool$asObject

Referenced by eZTreeMenuOperator\modify(), relatedObjects(), and eZContentObjectTreeNode\subTreeByNodeID().

static eZContentObject::fixReverseRelations (   $objectID,
  $mode = false 
)
static
eZContentObject::fixupInput (   $contentObjectAttributes,
  $attributeDataBaseName 
)
Parameters
eZContentObjectAttribute[]$contentObjectAttributes
string$attributeDataBaseName
eZContentObject::getVersionCount ( )

Returns the number of existing versions.

Returns
mixed

Referenced by createNewVersion().

eZContentObject::groupedDataMap ( )

Generates a map with all the content object attributes where the keys are the attribute identifiers grouped by class attribute category.

Result is not cached, so make sure you don't call this over and over.

Returns
array
eZContentObject::handleAllCustomHTTPActions (   $attributeDataBaseName,
  $customActionAttributeArray,
  $customActionParameters,
  $objectVersion = false 
)
Parameters
string$attributeDataBaseName
array$customActionAttributeArray
array$customActionParameters
int | bool$objectVersion
eZContentObject::handleCustomHTTPActions (   $contentObjectAttribute,
  $attributeDataBaseName,
  $customActionAttributeArray,
  $customActionParameters 
)
Parameters
eZContentObjectAttribute$contentObjectAttribute
string$attributeDataBaseName
array$customActionAttributeArray
array$customActionParameters

Referenced by fetchInput().

eZContentObject::hasContentAction (   $name)

Returns true if the given content action is in the content action list.

Parameters
string$nameName of the content action
Returns
bool

Referenced by contentActionList().

eZContentObject::hasRemainingVersions ( )

Returns true if the object has any versions remaining.

Returns
bool
eZContentObject::hasVisibleNode ( )

Returns whether the current object has at least one visible node.

The setting site.ini/[SiteAccessSettings]/ShowHiddenNodes is taken into account, ie an hidden (or hidden by superior) node is considered visible if ShowHiddenNodes is true.

Returns
boolean
eZContentObject::initialLanguage ( )

Returns the current object's initial language object, or false if not set.

Returns
eZContentLanguage|bool

Referenced by createNewVersion(), initialLanguageCode(), and setName().

eZContentObject::initialLanguageCode ( )

Returns the current object's initial language code, or false if not set.

Returns
string|bool

Referenced by contentActionList(), fetchInput(), and validateInput().

eZContentObject::isAlwaysAvailable ( )
Returns
int

Referenced by copyVersion().

static eZContentObject::isCacheExpired (   $timestamp)
static

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

Parameters
int$timestampUNIX Timestamp
Returns
bool

Referenced by eZNodeviewfunctions\contentViewRetrieve(), eZContentCache\exists(), and eZContentCache\restore().

static eZContentObject::isComplexViewMode (   $viewMode)
static

Returns true if the viewmode is a complex viewmode.

Parameters
string$viewMode
Returns
bool

Referenced by isComplexViewModeCacheExpired().

static eZContentObject::isComplexViewModeCacheExpired (   $viewMode,
  $timestamp 
)
static

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

Parameters
string$viewMode
int$timestampUNIX Timestamp
Returns
bool

Referenced by eZContentCache\exists(), and eZContentCache\restore().

eZContentObject::languages ( )
Returns
eZContentLanguage[]|array

Referenced by availableLanguages().

eZContentObject::linkedContentObjectCount (   $fromObjectVersion = false)

Returns the xml-linked objects count.

See Also
relatedObjectCount()
Parameters
int | bool$fromObjectVersion
Returns
int
eZContentObject::linkedContentObjectList (   $fromObjectVersion = false,
  $fromObjectID = false 
)

Returns the xml-linked objects.

See Also
relatedObjects()
Parameters
int | bool$fromObjectVersion
int | bool$fromObjectID
Returns
array|eZContentObject[]
eZContentObject::mainNode ( )

Returns the main node id for the current object.

Returns
int|null

Referenced by eZNodeviewfunctions\generateNodeViewData().

eZContentObject::mainNodeID ( )

Returns the main node id for the current object and sets the attribute MainNodeID in the current object.

Returns
int|null
eZContentObject::mainParentNodeID ( )

Returns the ID of the the current object's main node.

Returns
int|null
static eZContentObject::mapLanguage (   $language,
  $options 
)
static

Maps input lange to another one if defined in $options['language_map'].

If it cannot map it returns the original language.

Parameters
string$language
array$options
Returns
string
eZContentObject::matchIngroupIDList ( )

Get class groups this object's class belongs to if match for class groups is enabled, otherwise false.

Returns
array|bool
bool string Stores the current class eZContentObject::name (   $version = false,
  $lang = false 
)

Returns an object's name for the version given by $version in the language given by $lang.

Parameters
int | bool$versionIf omitted, the current version will be used
bool$langIf omitted, the initial object language will be used
Returns
bool|string
eZContentObject::names ( )

Returns all translations of the current object's name.

Returns
string[]
eZContentObject::nextVersion ( )

Returns the next available version number for this object.

Returns
int

Referenced by createNewVersion().

eZContentObject::owner ( )

Returns the owner of the object as a content object.

Returns
eZContentObject|null
eZContentObject::parentNodeIDArray ( )

Returns an array of parent node IDs.

Returns
int[]
eZContentObject::parentNodes (   $version = false,
  $asObject = true 
)

Returns the parent nodes for the current object.

Parameters
int | bool$versionNo longer in use, published nodes are used instead.
bool$asObjectIf true it fetches PHP objects, otherwise it fetches IDs.
Returns
eZContentObjectTreeNode[]|int[]

Referenced by parentNodeIDArray().

eZContentObject::permissions ( )

Returns the permission for the current object.

Returns
array
eZContentObject::postUnserialize (   $package)

Performs additional unserialization actions that need to be performed when all objects contained in the package are already installed.

(maintain objects' cross-relations)

Parameters
mixed$package
eZContentObject::previousVersion ( )

Returns the previous available version number for this object, if existing, false otherwise ( if the object has only one version )

Returns
int|bool
eZContentObject::purge ( )

Deletes the current object, all versions and translations, and corresponding tree nodes from the database.

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.

static eZContentObject::recursionProtect (   $id)
static
static eZContentObject::recursionProtectionEnd ( )
static
static eZContentObject::recursionProtectionStart ( )
static
eZContentObject::relatedContentObjectArray (   $fromObjectVersion = false,
  $fromObjectID = false,
  $attributeID = 0,
  $params = false 
)

Left for compatibility.

See Also
relatedObjects()
Deprecated:
Parameters
bool$fromObjectVersion
bool$fromObjectID
int$attributeID
bool$params
Returns
array
eZContentObject::relatedContentObjectCount (   $fromObjectVersion = false,
  $attributeID = 0,
  $params = false 
)

Returns the number of related objects.

See Also
relatedObjectCount()
Parameters
int | bool$fromObjectVersion
int | bool$attributeID
array | bool$params
Returns
int

Referenced by restoreXmlRelations().

eZContentObject::relatedContentObjectList (   $fromObjectVersion = false,
  $fromObjectID = false,
  $attributeID = 0,
  $groupByAttribute = false,
  $params = false 
)

Returns related objects.

See Also
relatedObjects()
Parameters
int | bool$fromObjectVersion
int | bool$fromObjectID
int | bool$attributeID
bool$groupByAttribute
array | bool$params
Returns
array|eZContentObject[]

Referenced by relatedContentObjectArray().

eZContentObject::relatedObjectCount (   $version = false,
  $attributeID = 0,
  $reverseRelatedObjects = false,
  $params = false 
)

Fetch the number of (reverse) related objects.

Parameters
bool | int$version
int$attributeIDThis parameter only makes sense if $params[AllRelations] is unset, set to false, or matches eZContentObject::RELATION_ATTRIBUTE Possible values:
  • 0 or false: Count relations made with any attribute
  • >0 Count relations made with attribute $attributeID
int | bool$reverseRelatedObjectsWether to count related objects (false) or reverse related objects (false)
array | bool$paramsVarious params, as an associative array. Possible values:
  • AllRelations (bool|int) true: count ALL relations, object and attribute level false: only count object level relations other: bit mask of eZContentObject::RELATION_* constants
  • IgnoreVisibility (bool) If true, 'hidden' status will be ignored
Returns
int The number of (reverse) related objects for the object

Referenced by embeddedContentObjectCount(), linkedContentObjectCount(), relatedContentObjectCount(), reverseEmbeddedObjectCount(), reverseLinkedObjectCount(), and reverseRelatedObjectCount().

eZContentObject::relatedObjects (   $fromObjectVersion = false,
  $objectID = false,
  $attributeID = 0,
  $groupByAttribute = false,
  $params = false,
  $reverseRelatedObjects = false 
)

Returns related or reverse related objects.

Parameters
int | bool$fromObjectVersionIf omitted, the current version will be used
int | bool$objectIDIf omitted, the current object will be used
int | bool$attributeIDmakes sense only when $params['AllRelations'] not set or eZContentObject::RELATION_ATTRIBUTE $attributeID = 0|false ( $params['AllRelations'] is eZContentObject::RELATION_ATTRIBUTE )
  • return relations made with any attributes $attributeID > 0
  • return relations made with attribute ID ( "related object(s)" datatype ) $attributeID = false ( $params['AllRelations'] not set )
  • return ALL relations (deprecated, use "$params['AllRelations'] = true" instead)
bool$groupByAttributeThis parameter makes sense only when $attributeID == false or $params['AllRelations'] = true $groupByAttribute = false
  • return all relations as an array of content objects $groupByAttribute = true
  • return all relations groupped by attribute ID
array | bool$paramsOther parameters from template fetch function $params['AllRelations'] = true
  • return ALL relations, including attribute-level $params['AllRelations'] = false
  • return objec level relations only $params['AllRelations'] = int > 0
  • bit mask of EZ_CONTENT_OBJECT_RELATION_* values $params['SortBy']
  • Possible values: "class_identifier", "class_name", "modified", "name", "published", "section" $params['IgnoreVisibility'] = true
  • Include related objects with a 'hidden' state $params['IgnoreVisibility'] = false
  • Exclude related objects with a 'hidden' state $params['RelatedClassIdentifiers'] = array
  • limit returned relations to objects of the specified class identifiers
bool$reverseRelatedObjectstrue -> returns reverse related objects false -> returns related objects
Returns
eZContentObject[]|array eZContentObject[], if $params['AsObject'] is set to true (default), array otherwise

Referenced by commitInputRelations(), embeddedContentObjectList(), linkedContentObjectList(), relatedContentObjectList(), reverseEmbeddedObjectList(), reverseLinkedObjectList(), and reverseRelatedObjectList().

static eZContentObject::relationTypeMask (   $allRelations = false)
static
Parameters
bool$allRelations
Returns
int

Referenced by eZContentFunctionCollection\contentobjectRelationTypeMask(), relatedObjectCount(), and relatedObjects().

eZContentObject::remoteID ( )

Returns the remote id of the current content object.

Returns
string
eZContentObject::removeContentObjectRelation (   $toObjectID = false,
  $fromObjectVersion = false,
  $attributeID = 0,
  $relationType = eZContentObject::RELATION_COMMON 
)

Removes a link to the given content object id.

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
int | bool$toObjectIDIf false it will delete relations to all the objects.
bool$fromObjectVersion
int$attributeIDID of class attribute. If it is > 0 we remove relations created by a specific objectrelation[list] attribute. If it is set to 0 we remove relations created without using of objectrelation[list] attribute. If it is set to false, we remove all relations, no matter how were they created: using objectrelation[list] attribute or using "Add related objects" functionality in obect editing mode.
int$relationType

Referenced by commitInputRelations().

eZContentObject::removeThis (   $nodeID = null)

Archives the current object and removes assigned nodes.

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
int$nodeID
eZContentObject::removeTranslation (   $languageID)

Removes a translation from the current object.

Parameters
int$languageID
Returns
bool
static eZContentObject::removeVersions (   $versionStatus = false)
static
Parameters
int | bool$versionStatus
Deprecated:
This method is left here only for backward compatibility. Use eZContentObjectVersion::removeVersions() method instead.
eZContentObject::rename (   $newName)

Sets the object's name to $newName: tries to find attributes that are in 'object pattern name' and updates them.

Parameters
string$newName
Returns
bool true if object's name was changed, otherwise false.
eZContentObject::resetDataMap ( )

Resets (empties) the current object's data map.

Returns
array

Referenced by __clone().

eZContentObject::resetInputRelationList ( )

Resets the object's input relation list.

Referenced by appendInputRelationList(), and validateInput().

eZContentObject::restoreObjectAttributes ( )

Restores attributes for current content object when it's being restored from trash.

eZContentObject::reverseEmbeddedObjectCount (   $fromObjectVersion = false)

Returns the reverse xml-embedded objects count.

See Also
relatedObjectCount()
Parameters
int | bool$fromObjectVersion
Returns
int
eZContentObject::reverseEmbeddedObjectList (   $fromObjectVersion = false,
  $fromObjectID = false 
)

Returns the reverse xml-embedded objects.

See Also
relatedObjects()
Parameters
int | bool$fromObjectVersion
int | bool$fromObjectID
Returns
array|eZContentObject[]
eZContentObject::reverseLinkedObjectCount (   $fromObjectVersion = false)

Returns the reverse xml-linked objects count.

See Also
relatedObjectCount()
Parameters
int | bool$fromObjectVersion
Returns
int
eZContentObject::reverseLinkedObjectList (   $fromObjectVersion = false,
  $fromObjectID = false 
)

Returns the reverse xml-linked objects.

See Also
relatedObjects()
Parameters
int | bool$fromObjectVersion
int | bool$fromObjectID
Returns
array|eZContentObject[]
eZContentObject::reverseRelatedObjectCount (   $version = false,
  $attributeID = 0,
  $params = false 
)

Returns the number of objects to which this object is related.

See Also
relatedObjectCount()
Parameters
int | bool$version
int | bool$attributeID
array | bool$params
Returns
int
eZContentObject::reverseRelatedObjectList (   $version = false,
  $attributeID = 0,
  $groupByAttribute = false,
  $params = false 
)

Returns the objects to which this object are related .

See Also
relatedObjects()
Parameters
int | bool$version
int | bool$attributeID
bool$groupByAttribute
array | bool$params
Returns
array|eZContentObject[]

Referenced by contentObjectListRelatingThis().

eZContentObject::sectionIdentifier ( )

Returns object's section identifier.

Returns
string|bool
eZContentObject::serialize (   $package,
  $specificVersion = false,
  $options = false,
  $contentNodeIDArray = false,
  $topNodeIDArray = false 
)

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

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
mixed$package
int | bool$specificVersionContent object version, true for current version, false for all, else array containing specific versions.
array | bool$optionsPackage options or false
int[]|bool$contentNodeIDArray Array of allowed nodes or false
int[]|bool$topNodeIDArray Array of top nodes in current package export or false
Returns
bool|DOMElement
eZContentObject::setAlwaysAvailableLanguageID (   $languageID,
  $version = false 
)
Parameters
int$languageID
int | bool$version
eZContentObject::setCachedName (   $name)

Sets the name of the object, in memory only.

Use {

See Also
setName()} to change it permanently
Parameters
string$name
eZContentObject::setClassName (   $name)
Parameters
string$name
eZContentObject::setContentObjectAttributes ( $attributes,
  $version,
  $language 
)

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

Parameters
eZContentObjectAttribute[]$attributes
int$version
string$language
eZContentObject::setCurrentLanguage (   $lang)

Sets the current object's language and resets the name.

Parameters
string$lang
static eZContentObject::setDefaultLanguage (   $lang)
static

Set default language.

Checks if default language is valid.

Deprecated:
Parameters
string$langDefault language.
Returns
bool
eZContentObject::setName (   $objectName,
  $versionNum = false,
  $languageCode = false 
)

Sets the name of the object in all translations.

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
string$objectName
int | bool$versionNum
int | bool$languageCode
eZContentObject::setPermissions (   $permissionArray)

Sets the permissions for this object.

Parameters
array$permissionArray
eZContentObject::stateIDArray (   $refreshCache = false)

Gets the current states of the content object.

Uses a member variable that caches the result.

Parameters
bool$refreshCacheif the cache in the member variable needs to be refreshed
Returns
array an associative array with state group id => state id pairs

Referenced by assignState().

eZContentObject::stateIdentifierArray ( )
Returns
array
eZContentObject::store (   $fieldFilters = null)

Stores the object.

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
array$fieldFilters

Referenced by removeThis(), removeTranslation(), serialize(), setAlwaysAvailableLanguageID(), and eZContentFunctions\updateAndPublishObject().

eZContentObject::storeInput (   $contentObjectAttributes,
  $attributeInputMap 
)

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
eZContentObjectAttribute[]$contentObjectAttributes
array$attributeInputMap
eZContentObject::storeNodeModified ( )

Update all nodes to set modified_subnode value.

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

static eZContentObject::translationList ( )
static

Returns an array with locale objects, these objects represents the languages the content objects are allowed to be translated into.

The setting ContentSettings/TranslationList in site.ini determines the array.

Returns
eZLocale[]

Referenced by eZContentFunctionCollection\fetchTranslationList(), eZContentObjectPackageCreator\initializeObjectLimits(), eZContentObjectPackageCreator\loadObjectLimits(), and eZContentObjectVersion\nonTranslationList().

static eZContentObject::translationStringList ( )
static

Returns an array with locale strings, these strings represents the languages which content objects are allowed to be translated into.

The setting ContentSettings/TranslationList in site.ini determines the array.

Returns
string[]
eZContentObject::validateInput (   $contentObjectAttributes,
  $attributeDataBaseName,
  $inputParameters = false,
  $parameters = array() 
)
Parameters
eZContentObjectAttribute[]$contentObjectAttributes
string$attributeDataBaseName
array | bool$inputParameters
array$parameters
Returns
array
eZContentObject::version (   $version,
  $asObject = true 
)

Returns the given object version.

False is returned if the versions does not exist.

Parameters
int$version
bool$asObjectIf true, returns an eZContentObjectVersion; if false, returns an array
Returns
eZContentObjectVersion|array|bool

Referenced by createNewVersion(), and serialize().

eZContentObject::versionLanguageName (   $version,
  $lang = false 
)

Returns the object name for version $version in the language $lang.

Parameters
int$version
string | bool$langIf omitted, the initial language of the object is used
Returns
string|bool

Referenced by name().

eZContentObject::versions (   $asObject = true,
  $parameters = array() 
)

Returns an array of eZContentObjectVersion for the current object according to the conditions in $parameters.

Parameters
bool$asObjectIf true, returns an eZContentObjectVersion; if false, returns an array
array$parameters
Returns
eZContentObjectVersion[]|array

Referenced by cleanupInternalDrafts(), copy(), createNewVersion(), hasRemainingVersions(), postUnserialize(), removeTranslation(), and serialize().

eZContentObject::visibleNodes ( )

Returns the visible nodes of the current object.

The main node is the first element in the returned value (if it is considered visible).

The setting site.ini/[SiteAccessSettings]/ShowHiddenNodes is taken into account, ie an hidden (or hidden by superior) node is considered visible if ShowHiddenNodes is true.

See Also
eZContentObject::assignedNodes
Returns
eZContentObjectTreeNode[]

Member Data Documentation

eZContentObject::$ClassIdentifier

Referenced by contentClassIdentifier().

eZContentObject::$ClassName

Referenced by className().

eZContentObject::$ContentActionList = false

Referenced by contentActionList().

eZContentObject::$ContentObjectAttributes = array()
eZContentObject::$CurrentLanguage
eZContentObject::$DataMap = array()

Referenced by resetDataMap().

eZContentObject::$InputRelationList = array()
eZContentObject::$MainNodeID = false

Referenced by mainNodeID().

eZContentObject::$Name

Referenced by name().

eZContentObject::$StateIDArray = false
private

Referenced by stateIDArray().

const eZContentObject::PACKAGE_DELETE = 4
const eZContentObject::PACKAGE_ERROR_EXISTS = 2
const eZContentObject::PACKAGE_ERROR_HAS_CHILDREN = 102
const eZContentObject::PACKAGE_ERROR_MODIFIED = 101
const eZContentObject::PACKAGE_ERROR_NO_CLASS = 1
const eZContentObject::PACKAGE_ERROR_NODE_EXISTS = 3
const eZContentObject::PACKAGE_KEEP = 5
const eZContentObject::PACKAGE_NEW = 3
const eZContentObject::PACKAGE_REPLACE = 1
const eZContentObject::PACKAGE_SKIP = 2
const eZContentObject::PACKAGE_UPDATE = 6

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