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   ]
                                      [ 'sorts',         sorts   ] ) )

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.
sorts array A new parameter since eZ Publish 4.1 which enables you to sort the returned versions 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.

Example 2

fetch('content', 'version_list', hash('sorts', array(...)))</pre>

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

Ester Heylen (18/11/2009 3:37 pm)

Balazs Halasy, Ester Heylen


Comments

There are no comments.