Forums / Developer / get the list of objects

get the list of objects

Author Message

Bass The Butcher

Sunday 27 July 2008 4:44:29 am

Hi all,

I need to get a list of objects of particular class and particular owner within PHP code, not template.
For example I need to delete all articles of user with id:12.

Thanks.

Pascal Specht

Monday 28 July 2008 9:19:53 am

Hi,

I would use the fetch function, like this (exemple, get all products):

$list = eZContentObjectTreeNode::subTree( array( 'Depth' => 100,
											 'ClassFilterType' => 'include',
											 'ClassFilterArray' => array('product') ), 2 );

and then loop through the objects looking ofr their creator ID or placement, to find out who they belong to.

Hope this helps,
Cheers,

</Pascal>