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
Name | Type | Description | Required |
---|---|---|---|
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:11 pm)
Comments
There are no comments.