eZ Publish  [4.0]
eZContentObjectVersion Class Reference

The class eZContentObjectVersion handles different versions of an content object eZKernel. More...

+ Inheritance diagram for eZContentObjectVersion:
+ Collaboration diagram for eZContentObjectVersion:

List of all members.

Public Member Functions

 assignToNode ($nodeID, $main=0, $fromNodeID=0, $sortField=null, $sortOrder=null, $remoteID=0)
 canVersionRead ()
 canVersionRemove ()
 checkAccess ($functionName, $originalClassID=false, $parentClassID=false, $returnAccessList=false, $language=false)
 clearAlwaysAvailableLanguageID ()
 cloneVersion ($newVersionNumber, $userID, $contentObjectID=false, $status=eZContentObjectVersion::STATUS_DRAFT)
 contentObject ()
 contentObjectAttributes ($languageCode=false, $asObject=true)
 creator ()
 dataMap ()
 defaultTranslationList ()
 eZContentObjectVersion ($row=array())
 hasConflicts ($editLanguage=false)
 initialLanguage ()
 initialLanguageCode ()
 languageMask ()
 mainParentNodeID ()
 name ($lang=false)
 nodeAssignments ()
 nonTranslatableAttributesToUpdate ()
 nonTranslationList ()
 parentNodes ()
 postUnserialize ($package)
 relatedContentObjectArray ()
 removeAssignment ($nodeID)
 removeThis ()
 removeTranslation ($languageCode)
 resetDataMap ()
 reverseRelatedObjectList ()
 serialize ($package, $options=false, $contentNodeIDArray=false, $topNodeIDArray=false)
 setAlwaysAvailableLanguageID ($languageID)
 store ($fieldFilters=null)
 tempMainNode ()
 translation ($asObject=true)
 translationList ($language=false, $asObject=true)
 translations ($asObject=true)
 unpublish ()
 updateLanguageMask ($mask=false, $forceStore=true)
 versionName ($lang=false)

Static Public Member Functions

static create ($contentobjectID, $userID=false, $version=1, $initialLanguageCode=false)
static definition ()
static fetch ($id, $asObject=true)
static fetchAttributes ($version, $contentObjectID, $language=false, $asObject=true)
static fetchFiltered ($filters, $offset, $limit)
static fetchForUser ($userID, $status=eZContentObjectVersion::STATUS_DRAFT)
static fetchUserDraft ($objectID, $userID)
static fetchVersion ($version, $contentObjectID, $asObject=true)
static removeVersions ($versionStatus=false, $limit=false, $expiryTime=false, $fetchPortionSize=50)
static statusList ($limit=false)
static unserialize ($domNode, $contentObject, $ownerID, $sectionID, $activeVersion, $firstVersion, &$nodeList, &$options, $package, $handlerType= 'ezcontentobject')

Public Attributes

 $CurrentLanguage = false
const STATUS_ARCHIVED = 3
const STATUS_DRAFT = 0
const STATUS_INTERNAL_DRAFT = 5
const STATUS_PENDING = 2
const STATUS_PUBLISHED = 1
const STATUS_REJECTED = 4
const STATUS_REPEAT = 6

Static Private Member Functions

static mapLanguage ($language, $options)

Detailed Description

The class eZContentObjectVersion handles different versions of an content object eZKernel.

Definition at line 48 of file ezcontentobjectversion.php.


Member Function Documentation

eZContentObjectVersion::assignToNode ( nodeID,
main = 0,
fromNodeID = 0,
sortField = null,
sortOrder = null,
remoteID = 0 
)

Definition at line 761 of file ezcontentobjectversion.php.

eZContentObjectVersion::canVersionRead ( )
Returns:
true if the current user can read this version of the object.
Note:
The reference for the return value is required to workaround a bug with PHP references.

Definition at line 345 of file ezcontentobjectversion.php.

eZContentObjectVersion::canVersionRemove ( )
Returns:
true if the current user can remove this version of the object.
Note:
The reference for the return value is required to workaround a bug with PHP references.

Definition at line 359 of file ezcontentobjectversion.php.

eZContentObjectVersion::checkAccess ( functionName,
originalClassID = false,
parentClassID = false,
returnAccessList = false,
language = false 
)

Definition at line 368 of file ezcontentobjectversion.php.

Referenced by canVersionRead(), and canVersionRemove().

eZContentObjectVersion::clearAlwaysAvailableLanguageID ( )

Definition at line 1730 of file ezcontentobjectversion.php.

eZContentObjectVersion::cloneVersion ( newVersionNumber,
userID,
contentObjectID = false,
status = eZContentObjectVersion::STATUS_DRAFT 
)

Clones the version with new version $newVersionNumber and creator $userID

Note:
The cloned version is not stored.

Definition at line 1046 of file ezcontentobjectversion.php.

eZContentObjectVersion::contentObject ( )
eZContentObjectVersion::contentObjectAttributes ( languageCode = false,
asObject = true 
)

Returns the attributes for the current content object version. If $language is not specified it will use the initial language of the version.

Definition at line 1146 of file ezcontentobjectversion.php.

Referenced by dataMap(), postUnserialize(), removeTranslation(), and serialize().

static eZContentObjectVersion::create ( contentobjectID,
userID = false,
version = 1,
initialLanguageCode = false 
) [static]

Definition at line 851 of file ezcontentobjectversion.php.

Referenced by assignToNode(), and tempMainNode().

eZContentObjectVersion::creator ( )
Returns:
the creator of the current version.

Definition at line 1559 of file ezcontentobjectversion.php.

eZContentObjectVersion::dataMap ( )
Returns:
the content object attribute

Definition at line 806 of file ezcontentobjectversion.php.

eZContentObjectVersion::defaultTranslationList ( )
Returns:
An array with all translations except default language for the this version.
Note:
The reference for the return value is required to workaround a bug with PHP references.
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 1137 of file ezcontentobjectversion.php.

static eZContentObjectVersion::definition ( ) [static]
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:

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

Reimplemented from eZPersistentObject.

Definition at line 69 of file ezcontentobjectversion.php.

Referenced by fetch(), fetchFiltered(), fetchForUser(), fetchUserDraft(), fetchVersion(), and eZContentObject\versions().

eZContentObjectVersion::eZContentObjectVersion ( row = array())

Definition at line 59 of file ezcontentobjectversion.php.

Referenced by create().

static eZContentObjectVersion::fetch ( id,
asObject = true 
) [static]
Returns:
true if the requested attribute exists in object.

Definition at line 177 of file ezcontentobjectversion.php.

Referenced by checkAccess(), contentObject(), creator(), initialLanguage(), and nonTranslatableAttributesToUpdate().

static eZContentObjectVersion::fetchAttributes ( version,
contentObjectID,
language = false,
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
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 1171 of file ezcontentobjectversion.php.

Referenced by contentObjectAttributes(), and eZContentObjectTranslation\objectAttributes().

static eZContentObjectVersion::fetchFiltered ( filters,
offset,
limit 
) [static]

Definition at line 220 of file ezcontentobjectversion.php.

Referenced by removeVersions().

static eZContentObjectVersion::fetchForUser ( userID,
status = eZContentObjectVersion::STATUS_DRAFT 
) [static]
static eZContentObjectVersion::fetchUserDraft ( objectID,
userID 
) [static]

Definition at line 196 of file ezcontentobjectversion.php.

eZContentObjectVersion::hasConflicts ( editLanguage = false)

Definition at line 1740 of file ezcontentobjectversion.php.

eZContentObjectVersion::initialLanguage ( )

Definition at line 1651 of file ezcontentobjectversion.php.

Referenced by initialLanguageCode().

eZContentObjectVersion::initialLanguageCode ( )
eZContentObjectVersion::languageMask ( )

Definition at line 1631 of file ezcontentobjectversion.php.

eZContentObjectVersion::mainParentNodeID ( )
Note:
The reference for the return value is required to workaround a bug with PHP references.

Definition at line 732 of file ezcontentobjectversion.php.

static eZContentObjectVersion::mapLanguage ( language,
options 
) [static, private]

Maps input lange to another one if defined in $options['language_map']. If it cannot map it returns the original language.

Returns:
string

Definition at line 1222 of file ezcontentobjectversion.php.

Referenced by unserialize().

eZContentObjectVersion::name ( lang = false)
Returns:
the name of the current version, optionally in the specific language $lang

Definition at line 282 of file ezcontentobjectversion.php.

eZContentObjectVersion::nodeAssignments ( )

Definition at line 756 of file ezcontentobjectversion.php.

Referenced by tempMainNode().

eZContentObjectVersion::nonTranslatableAttributesToUpdate ( )

Definition at line 1665 of file ezcontentobjectversion.php.

eZContentObjectVersion::nonTranslationList ( )
Returns:
an array with locale objects, these objects represents the languages the content objects are allowed to be translated into. The array will not include locales that has been translated in this version.

Definition at line 1611 of file ezcontentobjectversion.php.

eZContentObjectVersion::parentNodes ( )

Definition at line 745 of file ezcontentobjectversion.php.

eZContentObjectVersion::postUnserialize ( package)

Definition at line 1420 of file ezcontentobjectversion.php.

eZContentObjectVersion::relatedContentObjectArray ( )

Returns the related objects.

Definition at line 845 of file ezcontentobjectversion.php.

eZContentObjectVersion::removeAssignment ( nodeID)
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 787 of file ezcontentobjectversion.php.

eZContentObjectVersion::removeThis ( )
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 891 of file ezcontentobjectversion.php.

eZContentObjectVersion::removeTranslation ( languageCode)
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 953 of file ezcontentobjectversion.php.

static eZContentObjectVersion::removeVersions ( versionStatus = false,
limit = false,
expiryTime = false,
fetchPortionSize = 50 
) [static]

Will remove all version that match the status set in $versionStatus.

Parameters:
$versionStatuscan either be a single value or an array with values, if false the function will remove all status except published.
$limitlimits count of versions which should be removed.
$expiryTimeif not false then method will remove only versions which have modified time less than specified expiry time.
$fetchPortionSizeportion size for single fetch() call to avoid memory overflow erros (default 50).
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 982 of file ezcontentobjectversion.php.

eZContentObjectVersion::resetDataMap ( )

Definition at line 835 of file ezcontentobjectversion.php.

eZContentObjectVersion::reverseRelatedObjectList ( )
Note:
The reference for the return value is required to workaround a bug with PHP references.

Definition at line 882 of file ezcontentobjectversion.php.

eZContentObjectVersion::serialize ( package,
options = false,
contentNodeIDArray = false,
topNodeIDArray = false 
)
Returns:
a DOM structure of the content object version, it's translations and attributes.
Parameters:
package
packageoptions ( optianal )
arrayof allowed nodes ( optional )
arrayof top nodes in current package export (optional )
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 1441 of file ezcontentobjectversion.php.

eZContentObjectVersion::setAlwaysAvailableLanguageID ( languageID)

Definition at line 1696 of file ezcontentobjectversion.php.

Referenced by clearAlwaysAvailableLanguageID().

static eZContentObjectVersion::statusList ( limit = false) [static]

Definition at line 154 of file ezcontentobjectversion.php.

eZContentObjectVersion::store ( fieldFilters = null)

Stores the object in the database, uses storeObject() to do the actual job and passes $fieldFilters to it.

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 1767 of file ezcontentobjectversion.php.

Referenced by updateLanguageMask().

eZContentObjectVersion::tempMainNode ( )
Returns:
an eZContentObjectTreeNode object which doesn't really exist in the DB, this can be passed to a node view template.

Definition at line 236 of file ezcontentobjectversion.php.

eZContentObjectVersion::translation ( asObject = true)
Returns:
An array with all the translations for the current version.
Note:
The reference for the return value is required to workaround a bug with PHP references.
Deprecated:

Definition at line 1078 of file ezcontentobjectversion.php.

eZContentObjectVersion::translationList ( language = false,
asObject = true 
)
Returns:
An array with all the translations for the current version.
Note:
The reference for the return value is required to workaround a bug with PHP references.
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 1091 of file ezcontentobjectversion.php.

Referenced by defaultTranslationList(), nonTranslationList(), serialize(), translations(), and updateLanguageMask().

eZContentObjectVersion::translations ( asObject = true)
Returns:
An array with all the translations for the current version.
Note:
The reference for the return value is required to workaround a bug with PHP references.

Definition at line 1067 of file ezcontentobjectversion.php.

Referenced by nonTranslationList(), postUnserialize(), and removeThis().

eZContentObjectVersion::unpublish ( )
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 1573 of file ezcontentobjectversion.php.

static eZContentObjectVersion::unserialize ( domNode,
contentObject,
ownerID,
sectionID,
activeVersion,
firstVersion,
&$  nodeList,
&$  options,
package,
handlerType = 'ezcontentobject' 
) [static]

Unserialize xml structure. Create object from xml input.

Parameters:
XMLDOM Node
contentobject.
ownerID
sectionID
newobject, true if first version of new object
options
package
Returns:
created object, false if could not create object/xml invalid
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 1247 of file ezcontentobjectversion.php.

eZContentObjectVersion::updateLanguageMask ( mask = false,
forceStore = true 
)

Definition at line 1636 of file ezcontentobjectversion.php.

Referenced by removeTranslation().

eZContentObjectVersion::versionName ( lang = false)
Returns:
the name of the current version, optionally in the specific language $lang

Definition at line 310 of file ezcontentobjectversion.php.


Member Data Documentation

eZContentObjectVersion::$CurrentLanguage = false

Definition at line 1773 of file ezcontentobjectversion.php.


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