Forums / Developer / Attribute Filter by related objects in php

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Attribute Filter by related objects in php

Author Message

Łukasz Kęska

Tuesday 12 July 2011 12:28:58 am

Hi all

I have a problem creating fetch in php script using AttributeFilter on related objects list. I saw many examples how to do it in templates, so I thought it should be obvious:

$params = array(           
                'AttributeFilter'  => array(array('myclass/myattr','=',$objectid)),
                'Depth'             => 1,
                'ClassFilterType'   => 'include',
                'ClassFilterArray'  => array( 'myclass' ),
                'limit' => 1
            );

$list = eZContentObjectTreeNode::subTreeByNodeID( $params, $nodeid );

Where myclass is a class identificator, myattr is an object relation list attribute identificator and $objectid is a contentobjectID of an object chosen in object relation.

It just doesn't work. Please advice :-)

Lucas

 

Peter Keung

Tuesday 12 July 2011 12:55:00 pm

For object relation list, you have to use an extended attribute filter. Here is a recommendation for an existing one:

http://projects.ez.no/objectrelationfilter

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada