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
| Name | Type | Description | Required |
|---|---|---|---|
| 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".
Contributors
- Balazs Halasy Updated
- cindy Commenter
- Svitlana Shatokhina Commenter
Comments (2 historical)
Written by readers of the earlier documentation sites, kept as they were.
What is it mean? Thank you
cindy ·
{def $root_node=fetch( 'content', 'node', hash( 'node_id', $module_result.path[$pagerootdepth].node_id ) )
$left_menu_items = fetch( 'content', 'list', hash( 'parent_node_id', $root_node.node_id,
'sort_by', $root_node.sort_array,
'class_filter_type', 'include',
'class_filter_array', ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ) ) )
Re: What is it mean? Thank you
Svitlana Shatokhina ·
Hi, you need to check the documentation of "node" and "list" fetch functions:
http://ez.no/doc/ez_publish/techn...modules/content/fetch_functions/node
http://ez.no/doc/ez_publish/techn...modules/content/fetch_functions/list
Next time, please ask such questions at http://ez.no/developer/forum
Thank you!