original_string: public function GetWhere($Where, $Offset = 0, $Limit = 30) {
        if (is_string($Where)) {
           $Where = array($Where => $Offset);
           $Offset = 0;
        }
  
        // Add the basic activity query.
        $this->SQL
           ->Select('a2.*')
           ->Select('t.FullHeadline, t.ProfileHeadline, t.AllowComments, t.ShowIcon, t.RouteCode')
           ->Select('t.Name', '', 'ActivityType')
           ->From('Activity a')
           ->Join('Activity a2', 'a.ActivityID = a2.ActivityID') // self-join for index speed.
           ->Join('ActivityType t', 'a2.ActivityTypeID = t.ActivityTypeID');
        
        // Add prefixes to the where.
        foreach ($Where as $Key => $Value) {
           if (strpos($Key, '.') === FALSE) {
              $Where['a.'.$Key] = $Value;
              unset($Where[$Key]);
           }
        }
        
        $Result = $this->SQL
           ->Where($Where)
           ->OrderBy('a.DateUpdated', 'desc')
           ->Limit($Limit, $Offset)
           ->Get();
        
        self::GetUsers($Result->ResultArray());
        Gdn::UserModel()->JoinUsers($Result->ResultArray(), array('ActivityUserID', 'RegardingUserID'), array('Join' => array('Name', 'Email', 'Gender', 'Photo')));
        $this->CalculateData($Result->ResultArray());
        
        $this->EventArguments['Data'] =& $Result;
        $this->FireEvent('AfterGet');
        
        return $Result;
     }
code: public function GetWhere($Where, $Offset = 0, $Limit = 30) {
        if (is_string($Where)) {
           $Where = array($Where => $Offset);
           $Offset = 0;
        }
  
        // Add the basic activity query.
        $this->SQL
           ->Select('a2.*')
           ->Select('t.FullHeadline, t.ProfileHeadline, t.AllowComments, t.ShowIcon, t.RouteCode')
           ->Select('t.Name', '', 'ActivityType')
           ->From('Activity a')
           ->Join('Activity a2', 'a.ActivityID = a2.ActivityID') // self-join for index speed.
           ->Join('ActivityType t', 'a2.ActivityTypeID = t.ActivityTypeID');
        
        // Add prefixes to the where.
        foreach ($Where as $Key => $Value) {
           if (strpos($Key, '.') === FALSE) {
              $Where['a.'.$Key] = $Value;
              unset($Where[$Key]);
           }
        }
        
        $Result = $this->SQL
           ->Where($Where)
           ->OrderBy('a.DateUpdated', 'desc')
           ->Limit($Limit, $Offset)
           ->Get();
        
        self::GetUsers($Result->ResultArray());
        Gdn::UserModel()->JoinUsers($Result->ResultArray(), array('ActivityUserID', 'RegardingUserID'), array('Join' => array('Name', 'Email', 'Gender', 'Photo')));
        $this->CalculateData($Result->ResultArray());
        
        $this->EventArguments['Data'] =& $Result;
        $this->FireEvent('AfterGet');
        
        return $Result;
     }
code_tokens: public function GetWhere ( $ Where , $ Offset = 0 , $ Limit = 30 ) { if ( is_string ( $ Where ) ) { $ Where = array ( $ Where => $ Offset ) ; $ Offset = 0 ; } // Add the basic activity query. $ this -> SQL -> Select ( 'a2.*' ) -> Select ( 't.FullHeadline, t.ProfileHeadline, t.AllowComments, t.ShowIcon, t.RouteCode' ) -> Select ( 't.Name' , '' , 'ActivityType' ) -> From ( 'Activity a' ) -> Join ( 'Activity a2' , 'a.ActivityID = a2.ActivityID' ) // self-join for index speed. -> Join ( 'ActivityType t' , 'a2.ActivityTypeID = t.ActivityTypeID' ) ; // Add prefixes to the where. foreach ( $ Where as $ Key => $ Value ) { if ( strpos ( $ Key , '.' ) === FALSE ) { $ Where [ 'a.' . $ Key ] = $ Value ; unset ( $ Where [ $ Key ] ) ; } } $ Result = $ this -> SQL -> Where ( $ Where ) -> OrderBy ( 'a.DateUpdated' , 'desc' ) -> Limit ( $ Limit , $ Offset ) -> Get ( ) ; self :: GetUsers ( $ Result -> ResultArray ( ) ) ; Gdn :: UserModel ( ) -> JoinUsers ( $ Result -> ResultArray ( ) , array ( 'ActivityUserID' , 'RegardingUserID' ) , array ( 'Join' => array ( 'Name' , 'Email' , 'Gender' , 'Photo' ) ) ) ; $ this -> CalculateData ( $ Result -> ResultArray ( ) ) ; $ this -> EventArguments [ 'Data' ] = & $ Result ; $ this -> FireEvent ( 'AfterGet' ) ; return $ Result ; }
docstring: Modifies standard Gdn_Model->GetWhere to use AcitivityQuery.
  
  Events: AfterGet.
  
  @since 2.0.0
  @access public
  @param array $Where The where condition.
  @param int $Offset The offset of the query.
  @param int $Limit the limit of the query.
  @return DataSet SQL results.
docstring_tokens: Modifies standard Gdn_Model - > GetWhere to use AcitivityQuery .