public function GetCount($UserID = '') {
      $this->SQL
         ->Select('a.ActivityID', 'count', 'ActivityCount')
         ->From('Activity a')
         ->Join('ActivityType t', 'a.ActivityTypeID = t.ActivityTypeID');
      
      if ($UserID != '') {
         $this->SQL
            ->BeginWhereGroup()
            ->Where('a.ActivityUserID', $UserID)
            ->OrWhere('a.RegardingUserID', $UserID)
            ->EndWhereGroup();
      }
      
      $Session = Gdn::Session();
      if (!$Session->IsValid() || $Session->UserID != $UserID)
         $this->SQL->Where('t.Public', '1');

      $this->FireEvent('BeforeGetCount');
      return $this->SQL
         ->Get()
         ->FirstRow()
         ->ActivityCount;
   }
public function GetCount($UserID = '') {
      $this->SQL
         ->Select('a.ActivityID', 'count', 'ActivityCount')
         ->From('Activity a')
         ->Join('ActivityType t', 'a.ActivityTypeID = t.ActivityTypeID');
      
      if ($UserID != '') {
         $this->SQL
            ->BeginWhereGroup()
            ->Where('a.ActivityUserID', $UserID)
            ->OrWhere('a.RegardingUserID', $UserID)
            ->EndWhereGroup();
      }
      
      $Session = Gdn::Session();
      if (!$Session->IsValid() || $Session->UserID != $UserID)
         $this->SQL->Where('t.Public', '1');

      $this->FireEvent('BeforeGetCount');
      return $this->SQL
         ->Get()
         ->FirstRow()
         ->ActivityCount;
   }
public function GetCount ( $ UserID = '' ) { $ this -> SQL -> Select ( 'a.ActivityID' , 'count' , 'ActivityCount' ) -> From ( 'Activity a' ) -> Join ( 'ActivityType t' , 'a.ActivityTypeID = t.ActivityTypeID' ) ; if ( $ UserID != '' ) { $ this -> SQL -> BeginWhereGroup ( ) -> Where ( 'a.ActivityUserID' , $ UserID ) -> OrWhere ( 'a.RegardingUserID' , $ UserID ) -> EndWhereGroup ( ) ; } $ Session = Gdn :: Session ( ) ; if ( ! $ Session -> IsValid ( ) || $ Session -> UserID != $ UserID ) $ this -> SQL -> Where ( 't.Public' , '1' ) ; $ this -> FireEvent ( 'BeforeGetCount' ) ; return $ this -> SQL -> Get ( ) -> FirstRow ( ) -> ActivityCount ; }
Get number of activity related to a user.

Events: BeforeGetCount.

@since 2.0.0
@access public
@param string $UserID Unique ID of user.
@return int Number of activity items found.
Get number of activity related to a user .