original_string: public function ActivityQuery($Join = TRUE) {
        $this->SQL
           ->Select('a.*')
           ->Select('t.FullHeadline, t.ProfileHeadline, t.AllowComments, t.ShowIcon, t.RouteCode')
           ->Select('t.Name', '', 'ActivityType')
           ->From('Activity a')
           ->Join('ActivityType t', 'a.ActivityTypeID = t.ActivityTypeID');
        
        if ($Join) {
           $this->SQL
              ->Select('au.Name', '', 'ActivityName')
              ->Select('au.Gender', '', 'ActivityGender')
              ->Select('au.Photo', '', 'ActivityPhoto')
              ->Select('au.Email', '', 'ActivityEmail')
              ->Select('ru.Name', '', 'RegardingName')
              ->Select('ru.Gender', '', 'RegardingGender')
              ->Select('ru.Email', '', 'RegardingEmail')
              ->Select('ru.Photo', '', 'RegardingPhoto')
              ->Join('User au', 'a.ActivityUserID = au.UserID')
              ->Join('User ru', 'a.RegardingUserID = ru.UserID', 'left');
        }
           
        $this->FireEvent('AfterActivityQuery');
     }
code: public function ActivityQuery($Join = TRUE) {
        $this->SQL
           ->Select('a.*')
           ->Select('t.FullHeadline, t.ProfileHeadline, t.AllowComments, t.ShowIcon, t.RouteCode')
           ->Select('t.Name', '', 'ActivityType')
           ->From('Activity a')
           ->Join('ActivityType t', 'a.ActivityTypeID = t.ActivityTypeID');
        
        if ($Join) {
           $this->SQL
              ->Select('au.Name', '', 'ActivityName')
              ->Select('au.Gender', '', 'ActivityGender')
              ->Select('au.Photo', '', 'ActivityPhoto')
              ->Select('au.Email', '', 'ActivityEmail')
              ->Select('ru.Name', '', 'RegardingName')
              ->Select('ru.Gender', '', 'RegardingGender')
              ->Select('ru.Email', '', 'RegardingEmail')
              ->Select('ru.Photo', '', 'RegardingPhoto')
              ->Join('User au', 'a.ActivityUserID = au.UserID')
              ->Join('User ru', 'a.RegardingUserID = ru.UserID', 'left');
        }
           
        $this->FireEvent('AfterActivityQuery');
     }
code_tokens: public function ActivityQuery ( $ Join = TRUE ) { $ this -> SQL -> Select ( 'a.*' ) -> Select ( 't.FullHeadline, t.ProfileHeadline, t.AllowComments, t.ShowIcon, t.RouteCode' ) -> Select ( 't.Name' , '' , 'ActivityType' ) -> From ( 'Activity a' ) -> Join ( 'ActivityType t' , 'a.ActivityTypeID = t.ActivityTypeID' ) ; if ( $ Join ) { $ this -> SQL -> Select ( 'au.Name' , '' , 'ActivityName' ) -> Select ( 'au.Gender' , '' , 'ActivityGender' ) -> Select ( 'au.Photo' , '' , 'ActivityPhoto' ) -> Select ( 'au.Email' , '' , 'ActivityEmail' ) -> Select ( 'ru.Name' , '' , 'RegardingName' ) -> Select ( 'ru.Gender' , '' , 'RegardingGender' ) -> Select ( 'ru.Email' , '' , 'RegardingEmail' ) -> Select ( 'ru.Photo' , '' , 'RegardingPhoto' ) -> Join ( 'User au' , 'a.ActivityUserID = au.UserID' ) -> Join ( 'User ru' , 'a.RegardingUserID = ru.UserID' , 'left' ) ; } $ this -> FireEvent ( 'AfterActivityQuery' ) ; }
docstring: Build basis of common activity SQL query.
  
  @since 2.0.0
  @access public
docstring_tokens: Build basis of common activity SQL query .