fetch( 'content', 'related_objects' )
Defined in kernel/content/function_definition.php; it calls eZContentFunctionCollection::fetchRelatedObjects() (kernel/content/ezcontentfunctioncollection.php).
Operation type: read.
Parameters
| Parameter | Type | Required | Default |
|---|---|---|---|
object_id | integer | yes | |
attribute_identifier | string | no | '0' |
all_relations | boolean | no | false |
group_by_attribute | boolean | no | false |
sort_by | array | no | array() |
limit | integer | no | false |
offset | integer | no | false |
as_object | boolean | no | true |
load_data_map | boolean | no | false |
ignore_visibility | boolean | no | null |
related_class_identifiers | array | no | null |
Example
In a template (the values are placeholders of each parameter's type):
def $result = fetch( 'content', 'related_objects', hash( 'object_id', 1 ) )
{* with every parameter *}
{def $all = fetch( 'content', 'related_objects', hash( 'object_id', 1,
'attribute_identifier', '0',
'all_relations', true(),
'group_by_attribute', true(),
'sort_by', array(),
'limit', 1,
'offset', 1,
'as_object', true(),
'load_data_map', true(),
'ignore_visibility', true(),
'related_class_identifiers', array() ) )}In PHP, the same function through the function handler (lib/ezutils/classes/ezfunctionhandler.php):
$result = eZFunctionHandler::execute( 'content', 'related_objects', array( 'object_id' => 1 ) );In a shipped template
The first use in the templates of this installation, design/admin/templates/relations.tpl line 20:
def $related_objects_grouped = fetch( 'content', 'related_objects', hash( 'object_id', $node.object.id, 'all_relations', true(), 'group_by_attribute', true(), 'sort_by', array( array( 'class_identifier', true() ), array( 'name', true() ) ), 'offset', $offset, 'limit', $page_limit ) )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.