This is extendedattribte filter, which allows you to use as many extended attribute filters, as you wish (eZPublish kernel limitation - only one extended attributefilter per fetch). Also current extension provides user account attribute filter
How to install:
- Download the archive
- Unpack it to <path_to_ez_publish_root>/extension directory
- Activate nxc_extendedfilter extension in eZ Publish Admin area
- Extension is ready for use. Now you can use as many as you wish extended attribute filters in content fetch functions
How to use:
In content fetch function you should set nxc_extendedfilter extended attribute filter. As a sub_filters parameter you should an array of extended attribute filter definitions. Each definition is a hash with two keys:
- callback - a hash, which should have class_name and method_name values. class_name can be skipped, in this case nxcExtendedAttributeFilter will be used (but, currently, it has only one usefull method - userAccount). Each callback method should return array with tables, joins, columns and group_by keys (like normal extended attribute filter method). So you can use allready existing extended attribute filters, and you shouldn`t change them.
- params - a parameters hash, which will be used as a callback parameter. It can be skipped, in this case callback will be called with empty array as a parameter.
Example usage:
{def $test = fetch(
'content',
'list',
hash(
'parent_node_id', 5,
'class_filter_type', 'include',
'class_filter_array', array( 'user' ),
'depth', 0,
'extended_attribute_filter', hash(
'id', 'nxc_extendedfilter',
'params', hash(
'sub_filters', array(
hash(
'callback', hash(
'method_name', 'userAccount'
),
'params', hash(
'login', 'admin',
'email', 'sd@nxc.com.ua',
'enabled', 0
)
),
hash(
'callback', hash(
'class_name', 'myCustomClass',
'method_name', 'myCustomeMethod'
),
'params', hash(
'param_1', 'param_1_values',
'param_2', 'param_2_values'
)
)
)
)
)
)
)}
{$test|count()}