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 a collection of classes.


fetch( 'class', 'list', hash( [ 'class_filter', array( class_id | class_identifier [, ...] ) ] ) )


class_id integer The ID number of a desired class. No.
class_identifier string The identifier of a desired class. No.


Array of ezcontentclass objects or FALSE.


This function fetches a collection of classes. The optional "class_filter" parameter can be used to fetch only a given set of classes. This parameter must be either an array of class ID numbers or an array of class identifier strings (in other words: mixing is not possible). If the "class_filter" array is omitted, all classes will be returned.


Example 1

{def $classes=fetch( 'class', 'list' )}
{foreach $classes as $class}
    {$|wash} <br />

Outputs the names of all classes.

Example 2

{def $classes=fetch( 'class', 'list', hash( 'class_filter', array( 1, 2, 3 ) ) )}
{foreach $classes as $class}
    {$|wash} <br />

Outputs the names of class number 1, 2 and 3.

Example 3

{def $classes=fetch( 'class', 'list', hash( 'class_filter', array( 'folder', 'article' ) ) )}
{foreach $classes as $class}
    {$|wash} <br />

Outputs the names of the classes identified by the strings "folder" and "article".

Balazs Halasy (06/02/2004 11:54 am)

Balazs Halasy (29/04/2005 8:17 am)


There are no comments.