Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. function display_children($parentID, $level) {
  2.    
  3.     // get tasks at this level..
  4.     $task = new Task();
  5.         $task->include_related('tasktype', array('id', 'title', 'controller', 'colour'), TRUE, TRUE);
  6.         $task->include_related('flag', array('id', 'title', 'iconFile', 'colour'), TRUE, TRUE);
  7.     $task->where(id, $parentID);
  8.     $task->get();
  9.     //$task is a object
  10.    
  11.     // save the path in this array
  12.     $path = array();
  13.  
  14.         // see if this task has any children...
  15.         $taskChildCheck = new Task();
  16.             $taskChildCheck->where('parentTaskID', $taskID);
  17.             $taskChildCheck->get();
  18.             if($taskChildCheck->count())
  19.             {
  20.                 // has children
  21.                 echo 'I have children!';
  22.             }
  23.  
  24.    }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement