Example #1
0
 /**
  * Searches for subdivisions in the company structure that have a title that
  * match the given search string and returns all subdivions under those
  * matches as a comma separated string of subdivision ids.
  *
  * @param searchStr The string to match against subdivision IDs
  * @return comma separated string of subdivision ids or null if no match.
  */
 private function _getMatchingSubdivisionIds($searchStr)
 {
     $subdivisionIds = null;
     // Get list of workstations with matches in the title or matches higher in the hierachy
     $compStructObj = new CompStruct();
     $sublist = $compStructObj->getSubdivisionsUnderMatchInHierachy($searchStr);
     // Create select condition for employees with workstation set to any of the
     // subdivisions
     if (isset($sublist) && count($sublist) > 0) {
         $rowNum = 0;
         foreach ($sublist as $subdivision) {
             $subdivIdList[$rowNum] = $subdivision['id'];
             $rowNum++;
         }
         $subdivisionIds = implode(',', $subdivIdList);
     }
     return $subdivisionIds;
 }