Path / documentation / ez publish / technical manual / 3.7 / reference / modules / content / fetch functions / contentobject_attributes

Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.



Fetches the attributes of an object's version (and translation).


fetch( 'content', 'contentobject_attributes',
       hash( 'version',       version,
           [ 'language_code', language_code ] ) )


version object The target version (must be an ezcontentobjectversion object). Yes.
language_code string The language code. No.


An array of ezcontentobjectattribute objects or FALSE.


This function fetches the attributes that belong to a certain version. The version must be provided (as an ezcontentobjectversion) using the "version" parameter. The "language_code" parameter is optional and can be used to get the attributes that belong to a specific translation. The function returns an array of ezcontentobjectattribute objects or FALSE if something went wrong.


Example 1

{def $object=fetch( 'content', 'object', hash( 'object_id', 14 ) )
     $attributes=fetch( 'content, 'contentobject_attributes',
                        hash( 'version', $object.current ) )}
{foreach $attributes as $attribute}
    {$attribute.data_type_string} <br />

Outputs the names of the datatypes that are used by the different attributes within the current version of object number 14.

Balazs Halasy (06/02/2004 12:05 pm)

Balazs Halasy (29/04/2005 8:27 am)


  • possible error

    I had to seperate the example into to queries to get it to work.