mgd_list_persons_in_department_all

Name

mgd_list_persons_in_department_all -- List persons linked to a department topic tree

Synopsis

object mgd_list_persons_in_department_all(int department, string [sort]);

Description

Minimum version: Midgard 1.0 (Land Rover)

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 successfull. Returns false on failure.

Example

<?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";
   }
 }
?>