same_classattribute_node
Summary
Fetches nodes containing attributes that match a certain value.Usage
fetch( 'content', 'same_classattribute_node', hash( 'classattribute_id', classattribute_id, 'value', value, 'datatype', datatype ) )
Parameters
Name | Type | Description | Required |
---|---|---|---|
id | integer | The ID number of the class attribute that should be examined. | Yes. |
value | mixed | The value that should be matched. | Yes. |
datatype | string | Must be either "int", "float" or "text". | Yes. |
Returns
An array of ezcontentobjecttreenode objects or FALSE.
Description
This function will go through all object attributes that are instances of the class attribute specified by the "classattribute_id" parameter. The value that should be matched must be specified using the "value" parameter. In addition, the type of data (either "int", "float" or "text") that the datatype representing the attribute must be provided. The function returns an array of ezcontentobjecttreenode objects or FALSE (if there is no match).
Examples
{def $matched_nodes=fetch( 'content', 'same_classattribute_node', hash( 'classattribute_id', 245, 'value', 'example', 'datatype', 'text' ) )} {foreach $matched_nodes as $matched_node} {$matched_node.name|wash} <br /> {/foreach}
Outputs the names of the nodes that make use of class attribute number 245 and where the text contents of the object attribute equals the string "example".
Balazs Halasy (06/02/2004 12:12 pm)
Peter Keung (05/02/2009 7:08 pm)
Comments
There are no comments.