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 the number of objects that belong to certain section.


fetch( 'section', 'object_list_count',
        hash( 'section_id', section_id,							
            [ 'status',     status     ] ) )


section_id integer The ID number of the target section. Yes.
status string The status of the target objects ('published' by default). No.


The number of objects (as an integer) that belong to the section.


This function counts the number of objects that belong to a section specified by the "section_id" parameter. The optional "status" parameter works in the same way as in the "object_list" fetch function.

The function returns the count as an integer.


Example 1

{def $count=fetch( 'section', 'object_list_count',
                   hash( 'section_id', 13 ) )}
There are {$count} number of  objects in section number 13.

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

Example 2

{def $count=fetch( 'section', 'object_list_count',
                   hash( 'section_id', 5,
                         'status', 'archived' ) )}
There are {$count} number of archived objects in section number 5.

Outputs the number of objects that belong to section number 5 and are moved to the trash.

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

Julia Shymova (12/07/2007 11:58 am)


There are no comments.