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.

object_list

Summary

Fetches objects that belong to certain section.

Usage

fetch( 'section', 'object_list',
       hash( 'section_id', section_id,
           [ 'offset',     offset,    ]
           [ 'limit',      limit,     ]
           [ 'sort_order', sort_order ] ) )

Parameters

NameTypeDescriptionRequired
section_id integer The ID number of the target section. Yes.
offset integer The offset to start at. No.
limit integer The number of objects that should be fetched. No.
sort_order array The desired sorting order. No.

Returns

An array of ezcontentobject objects or FALSE.

Description

This function fetches a set of objects that belong to a certain section. The section must be specified by its ID number using the "section_id" parameter. The "offset", "limit" and "sort_order" parameters work in the same way as in the list fetch function of the "content" module. The function returns an array of ezcontentobject objects. If no objects can be found, or if the provided section ID number is invalid, FALSE will be returned.

Examples

Example 1

{def $objects=fetch( 'section', 'object_list',
                     hash( 'section_id', 13 ) )}
 
{foreach $objects as $object}
{$object.name} <br />
{/foreach}

Outputs the names of the objects that belong to section number 13.

Balazs Halasy (04/10/2004 1:35 pm)

Ole-Morten Halvorsen (17/07/2007 8:10 pm)

Balazs Halasy, Julia Shymova, Ole-Morten Halvorsen


Comments

There are no comments.