public static function getNumByUser($userUid)
 {
     $personalEventsQuery = PersonalEvent::where('user_uid', '=', $userUid);
     // add filters
     //
     $personalEventsQuery = EventDateFilter::apply($personalEventsQuery);
     return $personalEventsQuery->count();
 }
 public static function getNumUserProjectEvents($userUid)
 {
     $num = 0;
     // get optional project paramter
     //
     $projectUid = Input::get('project_uuid');
     if ($projectUid != '') {
         $project = Project::where('project_uid', '=', $projectUid)->first();
         // get events for a specific project
         //
         $userProjectEventsQuery = $project->getUserEventsQuery();
         // apply filters
         //
         $userProjectEventsQuery = EventDateFilter::apply($userProjectEventsQuery);
         $userProjectEventsQuery = LimitFilter::apply($userProjectEventsQuery);
         $num = $userProjectEventsQuery->count();
     } else {
         $userProjectEvents = new Collection();
         // collect events of user's projects
         //
         $user = User::getIndex($userUid);
         if ($user) {
             $projects = $user->getProjects();
             for ($i = 0; $i < sizeOf($projects); $i++) {
                 if ($projects[$i] != null) {
                     $userProjectEventsQuery = $projects[$i]->getUserEventsQuery();
                     // apply filters
                     //
                     $userProjectEventsQuery = EventDateFilter::apply($userProjectEventsQuery);
                     $userProjectEventsQuery = LimitFilter::apply($userProjectEventsQuery);
                     $num += $userProjectEventsQuery->count();
                 }
             }
         }
     }
     return $num;
 }