original_string: 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;
     }
code: 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;
     }
code_tokens: 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 ; }
docstring: 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.
docstring_tokens: Get number of activity related to a user .