count() public method

Returns the number of tasks including this and any sub tasks.
public count ( ) : integer
return integer The number of tasks and sub tasks.
Example #1
0
 /**
  * List all alarms near $date.
  *
  * @param integer $date  The unix epoch time to check for alarms.
  *
  * @return array  An array of tasks that have alarms that match.
  */
 public function listAlarms($date)
 {
     if (!$this->tasks->count()) {
         $result = $this->retrieve(0);
     }
     $alarms = array();
     $this->tasks->reset();
     while ($task = $this->tasks->each()) {
         if ($task->alarm && ($due = $task->getNextDue()) && $due->timestamp() - $task->alarm * 60 <= $date) {
             $alarms[$task_id] = $task;
         }
     }
     return $alarms;
 }