object
Summary
Fetches a content object (specified by an ID number).
Usage
fetch( 'content', 'object', hash( 'object_id', object_id )
( 'remote_id', remote_id ) )Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| object_id | integer | The ID number of the target object. | Yes. |
| remote_id | string | New parameter since Exponential 4.1. This enables you to fetch an object based on its remote ID. | No. |
Returns
An ezcontentobject object or FALSE.
Description
This function fetches a content object. The ID number of the object must be specified using the "object_id" parameter. The function returns an ezcontentobject object. It will return FALSE if a non-existing ID number is provided or if an error occurs.
Examples
Example 1
{def $object=fetch( 'content', 'object', hash( 'object_id', 13 ) )}
{$object.name|wash}Outputs the name of object number 13.
Example 2
fetch('content', 'object', hash('remote_id', 'f5c88a2209584891056f987fd965b0ba'))Changed in Exponential 6.0.15
The parameters of fetch( 'content', 'object' ) as kernel/content/function_definition.php of Exponential 6.0.15 defines them (eZContentFunctionCollection::fetchContentObject()):
| Parameter | Change |
|---|---|
| object_id | Required in 6.0.15: No. (this page: Yes.) |
Contributors
- Balazs Halasy Maintainer
- Ester Heylen Maintainer
- Graham Brookins Updated
Comments
Add a comment