fetch( 'content', 'list_count' )
Defined in kernel/content/function_definition.php; it calls eZContentFunctionCollection::fetchObjectTreeCount() (kernel/content/ezcontentfunctioncollection.php).
Operation type: read.
Parameters
| Parameter | Type | Required | Default |
|---|---|---|---|
parent_node_id | integer | yes | |
only_translated | bool | no | false |
language | string | no | false |
class_filter_type | string | no | false |
class_filter_array | array | no | false |
attribute_filter | mixed | no | false |
depth | string | no | 1 |
depth_operator | string | no | 'le' |
ignore_visibility | bool | no | false |
limitation | array | no | null |
main_node_only | bool | no | false |
extended_attribute_filter | mixed | no | false |
objectname_filter | string | no | null |
Example
In a template (the values are placeholders of each parameter's type):
def $result = fetch( 'content', 'list_count', hash( 'parent_node_id', 1 ) )
{* with every parameter *}
{def $all = fetch( 'content', 'list_count', hash( 'parent_node_id', 1,
'only_translated', true(),
'language', 'language',
'class_filter_type', 'class_filter_type',
'class_filter_array', array(),
'attribute_filter', $attribute_filter,
'depth', 1,
'depth_operator', 'le',
'ignore_visibility', true(),
'limitation', array(),
'main_node_only', true(),
'extended_attribute_filter', $extended_attribute_filter,
'objectname_filter', 'objectname_filter' ) )}In PHP, the same function through the function handler (lib/ezutils/classes/ezfunctionhandler.php):
$result = eZFunctionHandler::execute( 'content', 'list_count', array( 'parent_node_id' => 1 ) );In a shipped template
The first use in the templates of this installation, design/base/override/templates/full/forum.tpl line 1:
let topic_count=fetch('content','list_count',hash(parent_node_id,$node.node_id))Related
Generated by ./console exp:help:examples from kernel/content/function_definition.php, kernel/content/ezcontentfunctioncollection.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.