ez projects / ezobjectstatesfilter
| UNIX name | Owner | Status | Version | Compatible with |
|---|---|---|---|---|
| ezobjectstatesfilter | Damien Pobel | stable | 1.0 | 4.1, 4.2, 4.3 |
ezobjectstatesfilter extension provides an extended attribute filter to filter on object states.
In templates, you can now use fetch( content, list ) to retrieve objects filtered by one or several object states :
{def $nodes=fetch( content, list, hash( parent_node_id, $node_id, extended_attribute_filter, hash( 'id', 'ObjectStateFilter', 'params', hash( 'states_identifiers', array( 'group_identifier/state_identifier', 'another_group/another_state' ), 'operator', 'and' ) ) ) )}
This code will return only content object tree nodes that contain a content object having group_identifier/state_identifier and another_group/another_state states.
The operator value should be 'and' either 'or', if it's omitted, the default value is 'and'.
Extended attribute filters are also available in the PHP API in eZContentObjectTreeNode::subTreeByNodeID() :
<?php $statesIdentifiers = array( 'comment_status/rejected', 'comment_status/waited' ); $param = array( 'ClassFilterType' => 'include', 'ClassFilterArray' => array( 'comment' ), 'ExtendedAttributeFilter' => array( 'id' => 'ObjectStateFilter', 'params' => array( 'states_identifiers' => $statesIdentifiers, 'operator' => 'or' ) ) ); $waitedRejectedComments = eZContentObjectTreeNode::subTreeByNodeID( $param, $BaseNodeID ); ?>
Release of eZ Object States Filter 1.0
Saturday 25 April 2009 13:24
Damien Pobel