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



Fetches all the versions of a content object.


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


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.


An array of ezcontentobjectversion objects.


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.


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}
    {$} <br />

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


There are no comments.