Share » Forums » Developer » How to fetch objects in PHP on...

How to fetch objects in PHP on specified attributes ?

How to fetch objects in PHP on specified attributes ?

Thursday 30 June 2005 12:25:16 pm - 3 replies

Modified on Wednesday 10 August 2005 8:48:36 am by Patrick ALLAERT

Author Message

perrin aybara

Friday 01 July 2005 1:56:33 am

you can filter on attributes using the eZContentObjectTreeNode::subTree() function

ex:

$params = array(
 'ClassFilterType' => 'include',
 'ClassFilterArray' => 'CommandLine',
 'AttributeFilter' => array( array(
 'CommandLine/product_id', 'eq', 100 ) )
); // assuming that CommandLine is the identifier of your class

$nodeList =& eZContentObjectTreeNode::subTree($params, $parentNodeId); // where $parentNodeId is the root node or whatever...

Patrick ALLAERT

Friday 01 July 2005 3:29:55 am

Thank you very much perrin !

This is exactly what I needed! Just a few corrections to fit my business:

'ClassFilterArray' => 'CommandLine' --> 'ClassFilterArray' => array( 'commandline' )
'eq' --> '='

Here the final result for reuse:

$params = array(
'ClassFilterType' => 'include',
'ClassFilterArray' => array( 'commandline' ),
'AttributeFilter' => array( array(
'commandeline/product_id', '=', 100 ) )
); // assuming that CommandLine is the identifier of your class
        
$nodeList =& eZContentObjectTreeNode::subTree( $params , $parentNodeId ); // where $parentNodeId is the root node or whatever...

Patrick ALLAERT
http://www.dixite.com/
http://users.pandora.be/patrick_allaert/

Christoph von Siebenthal

Sunday 13 September 2009 11:55:34 am

This was very usefull.

But for 4.1.3 you have to use:

eZContentObjectTreeNode::subTreeByNodeId( $searchParams, $nodeID)

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu