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

class_attribute

Summary

Fetches an attribute of a content class.

Usage

fetch( 'content', 'class_attribute', hash( 'attribute_id', attribute_id,
                                         [ 'version_id',   version_id ] ) )

Parameters

NameTypeDescriptionRequired
attribute_id integer The ID number of the class attribute that should be fetched. Yes.
version_id integer The status/version of the class. No.

Returns

The specified class attribute as an ezcontentclassattribute object or FALSE.

Description

This function fetches the class attribute specified by the "attribute_id" parameter and returns it as an ezcontentclassattribute object. The function will return FALSE if the specified class attribute is unavailable. The optional "version_id" parameter can be used to fetch the specified class attribute from a certain version of a class. The following versions / status codes can be used:

  • 0: defined
  • 1: temporary
  • 2: modified

Examples

Example 1

{def $class_attribute=fetch( 'content', 'class_attribute', hash( 'attribute_id', 231 ) )}
{$class_attribute.name|wash}

Outputs the name of class attribute number 231.

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

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


Comments