mgd_list_persons_in_department_all

(Midgard 1.4.2 'Bifrost')

mgd_list_persons_in_department_all -- List persons linked to a department topic tree

Description

object mgd_list_persons_in_department_all (int department, string [sort])

Minimum version: Midgard 1.0

Lists all persons linked to department topic department and it's subtopics. The department link in the person record contains an id number that should point to a topic record. This function returns all the person records with the given department link pointing to any topic in the topic tree starting from the topic given as the department argument.

Returns an object traversable by calling fetch() if successful. Returns FALSE on failure.


<?php
 $dept = 13;
 $sort = "alpha";
 $people = mgd_list_persons_in_department_all( $dept, $sort );
 if( $people->N == 0 ) {
   echo "No people in (sub)department(s) $dept.&lt;br>";
 } else {
   while( $people->fetch() ) {
     echo $people->name . "<br>\n";
   }
 }
?>