Esempio n. 1
0
 public function getTodos($type = "all", $max = 5)
 {
     sfContext::getInstance()->getLogger()->info('begin selecting upcoming tasks');
     $c = new Criteria();
     $c->addAscendingOrderByColumn(TaskPeer::FINISH);
     $c->add(TaskPeer::STATUS, sfConfig::get('app_task_status_open'));
     $c->add(TaskPeer::DELETED_AT, null);
     $tasks = TaskPeer::retrieveByUserId($this->getUserId(), $c);
     sfContext::getInstance()->getLogger()->info('finish selecting upcoming tasks');
     sfContext::getInstance()->getLogger()->info('begin selecting todos, though the date is f#$2d up');
     $c = new Criteria();
     $c->addAscendingOrderByColumn(ToDoPeer::FINISH);
     $todos = $this->getsfGuardUser()->getTodos($c);
     sfContext::getInstance()->getLogger()->info('finished grabbing screwy todo list');
     if ($type == "all") {
         $tasks_array = array();
         $task_array['todos'] = $todos;
         $task_array['tasks'] = $tasks;
         return $task_array;
     } elseif ($type == 'todos') {
         return $todos;
     }
     return $tasks;
 }