ibexa

Path

ez publish / technical manual / 3.10 / reference / modules / content / fetch functions / collected_info_count


Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

collected_info_count

Summary

Fetches the number of collections that match a certain criteria.

Usage

fetch( 'content', 'collected_info_count',
       hash( [ 'object_attribute_id', object_attribute_id, ]
             [ 'object_id',           object_id,           ]
             [ 'value',               value                ] ) )

Parameters

NameTypeDescriptionRequired
object_attribute_id integer The ID number of the target object attribute. No.
object_id integer The ID number of the target content object. No.
value integer Value filtering on the attribute level. No.

Returns

The number of collections (as an integer).

Description

This function counts the number of collections based on the provided parameters. An object's ID number (using the "object_id" parameter) or an object attribute's ID number (using the "object_attribute_id" parameter) must be specified. In addition, it is possible to filter out collections that match a certain value. This is typically useful when it comes to counting the number of times a specific value was submitted to a poll. If the "value" parameter is used then the "object_attribute_id" parameter must also be provided. The function returns a positive integer if the system is able to find collections matching the given parameters; if not, zero will be returned.

Examples

Example 1

{def $collections=fetch( 'content', 'collected_info_count',
                          hash( 'object_attribute_id', 42,
                                'object_id',           20,
                                'value',                1 ) )}
{$collections}

Outputs the number of times attribute #42 for object number 20 has collected "1".

Balazs Halasy (06/02/2004 12:05 pm)

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


Comments

There are no comments.