Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

version_list

Summary

Fetches all the versions of a content object.

Usage

fetch( 'content', 'version_list', hash( 'contentobject', object,
                                      [ 'offset',        offset, ]
                                      [ 'limit',         limit   ] ) )

Parameters

NameTypeDescriptionRequired
contentobject object The target object. Yes.
offset integer Offset to start at. No.
limit integer The number of versions that should be fetched. No.

Returns

An array of ezcontentobjectversion objects.

Description

This function fetches all the versions of a certain object. The object itself must be specified using the "contentobject" parameter. The "offset" and "limit" parameters are optional and can be used to limit the result. The function returns an array of ezcontentobjectversion objects.

Examples

Example 1

{* Fetch object number 13. *}
{def $object=fetch( 'content', 'object', hash( 'object_id', 13 ) )}
 
{* Fetch all the versions of object number 13. *}
{def $versions=fetch( 'content', 'version_list', hash( 'contentobject', $object ) )}
 
{* Loop through all versions and display their names. *}
{foreach $versions as $version}
    {$version.name} <br />
{/foreach}

Outputs the names of all versions that belong to object number 13.

Balazs Halasy (06/02/2004 12:16 pm)

Balazs Halasy (29/04/2005 9:04 am)


Comments

There are no comments.