version_list
Summary
Fetches all the versions of a content object.Usage
fetch( 'content', 'version_list', hash( 'contentobject', object, [ 'offset', offset, ] [ 'limit', limit ] ) )
Parameters
Name | Type | Description | Required |
---|---|---|---|
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.