Forums / Developer / Fetching object in ezpublish
walibda
Monday 01 November 2010 4:34:38 am
Hello All ,
I am very much new to using ez publish and to the community.
In my first Development ,I want to retrieve objects of type specified by class_filter_array and I use this query in my php code :
my class is 'test'
ezpublishversion 3.10
$params = array( 'ClassFilterType' => 'include', 'ClassFilterArray' => array('test')); $nodes =& eZContentObjectTreeNode::subTree($params,2); / echo count($nodes)." Elets \n===="; foreach ( $nodes as $key=>$node ) { echo $node->attribute('name')."\n"; }
If I used 'ClassFilterArray' => array('folder') it works .But Another class isn't works .
Thanks!Best regards,
Eirik Alfstad Johansen
Monday 01 November 2010 9:01:52 am
Hi walidba,
Have you ensured that you have the proper rights to read the content of these "other" classes that you're trying to fetch? Also, of course, that they exist directly under the top content node (node 2)?
Sincerely, Eirik Alfstad Johansen http://www.netmaking.no/
Monday 01 November 2010 9:12:27 am
Thank you for your reply.
The nodes directly under the content node (node 2). But for the rights can you tell me how to check if I have the necessary rights.
Monday 01 November 2010 10:05:59 am
Hi walibda,
The easiest way to check if it's a rights problem is to run the code as an admin user. If this doesn't work, make sure that you are spelling the content class identificator correctly.
Tuesday 02 November 2010 3:19:42 am
thank you Eirik.simply I forgot to call this method
$script->initialize();