Thursday 21 August 2008 11:35:24 am
In php you should really use the api, most of the objects that you use in templates (nodes, objects, classes, object attributes..) have a php class in kernel/classes/. And most of those classes have fetch functions. Your template example would look like this in php:
$nodes = eZContentObjectTreeNode::subTreeByNodeID(array(
'ClassFilterType' => 'include',
'ClassFilterArray' => array( 'video_flash_mm' ),
'Depth' => 1,
'DepthOperator' => 'eq'
), 365);
Or if you want to sort by the parent node:
$node = eZContentObjectTreeNode::fetch( 365 );
$nodes = $node->subTree(array(
'ClassFilterType' => 'include',
'ClassFilterArray' => array( 'video_flash_mm' ),
'Depth' => 1,
'DepthOperator' => 'eq',
'SortBy' => $node->sortArray()
));
Note: If you plan to use most of the attributes, then set the LoadDataMap parameter to true. Note2: For counts there usually similar functions that takes the same parameters, in the above case it would be ::subTreeCountByNodeID() and ->subTreeCount()
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom
|