related_objects_count
Summary
Fetches the number of related objects.
Usage
fetch( 'content', 'related_objects_count',
hash( 'object_id', object_id,
[ 'attribute_identifier', attribute_identifier, ]
[ 'all_relations', boolean, ] ) )Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| object_id | integer | The ID number of the target object. | Yes. |
| attribute_identifier | mixed | The ID number or class/attribute identifier of the target attribute. | No. |
| all_relations | boolean | Controls whether to fetch all types of relations or not, default is FALSE. | No. |
Returns
An integer (the number of related objects).
Description
This fetch function operates in almost the same way as the "related_objects" fetch function. The difference is that instead of returning the related objects themselves, it returns the count (the number of related objects that were found). The "related_objects_count" function takes the same parameters as the "related_objects" function with some exceptions (for example sorting is not supported). Please refer to the documentation of the "related_objects" function for a detailed description of the parameters.
Contributors
- Balazs Halasy Updated
- Svitlana Shatokhina Commenter
Comments (1 historical)
Written by readers of the earlier documentation sites, kept as they were.
3.7.1
Svitlana Shatokhina ·
The related_objects and related_objects_count fetch functions are available in 3.7.1 and later versions ( http://pubsvn.ez.no/nextgen/stabl...ngelogs/3.7/CHANGELOG-3.7.0-to-3.7.1 ).