MgdSchema method list_children
Description:
array __list_children(string 'class name')__
Minimum version: Midgard 1.8
Returns array of objects which are child types in Midgard tree and are not the same type as object's instance for which this method was called. All child objects are returned unconditionaly. You should use MidgardQueryBuilder, if you want to add some particular constraints.
An empty array will be returned if object's type has no parent attribute
defined in schema XML files, or if there are no child objects' records in database.
<?php
$object = new midgard_topic(123);
$array = $object->list_children("midgard_article");
if($array) {
$n = count($array);
echo "<b> $n </b> child objects listed for $object->name";
}
?>
parentfield and parent class name for child object should be defined in XML schema file
