original_string: public function getRespondentTracks($respondentId, $organizationId, $order = array('gr2t_start_date'))
      {
          $select = $this->db->select()
                  ->from('gems__respondent2track')
                  ->joinInner('gems__tracks', 'gr2t_id_track = gtr_id_track')
                  ->joinInner('gems__reception_codes', 'gr2t_reception_code = grc_id_reception_code')
                  ->where('gr2t_id_user = ? AND gr2t_id_organization = ?');
          if (!is_null($order)) {
              $select->order($order);
          }
          $rows   = $this->db->fetchAll($select, array($respondentId, $organizationId));
          $tracks = array();
  
          foreach ($rows as $row) {
              $tracks[$row['gr2t_id_respondent_track']] = $this->getRespondentTrack($row);
          }
  
          return $tracks;
      }
code: public function getRespondentTracks($respondentId, $organizationId, $order = array('gr2t_start_date'))
      {
          $select = $this->db->select()
                  ->from('gems__respondent2track')
                  ->joinInner('gems__tracks', 'gr2t_id_track = gtr_id_track')
                  ->joinInner('gems__reception_codes', 'gr2t_reception_code = grc_id_reception_code')
                  ->where('gr2t_id_user = ? AND gr2t_id_organization = ?');
          if (!is_null($order)) {
              $select->order($order);
          }
          $rows   = $this->db->fetchAll($select, array($respondentId, $organizationId));
          $tracks = array();
  
          foreach ($rows as $row) {
              $tracks[$row['gr2t_id_respondent_track']] = $this->getRespondentTrack($row);
          }
  
          return $tracks;
      }
code_tokens: public function getRespondentTracks ( $ respondentId , $ organizationId , $ order = array ( 'gr2t_start_date' ) ) { $ select = $ this -> db -> select ( ) -> from ( 'gems__respondent2track' ) -> joinInner ( 'gems__tracks' , 'gr2t_id_track = gtr_id_track' ) -> joinInner ( 'gems__reception_codes' , 'gr2t_reception_code = grc_id_reception_code' ) -> where ( 'gr2t_id_user = ? AND gr2t_id_organization = ?' ) ; if ( ! is_null ( $ order ) ) { $ select -> order ( $ order ) ; } $ rows = $ this -> db -> fetchAll ( $ select , array ( $ respondentId , $ organizationId ) ) ; $ tracks = array ( ) ; foreach ( $ rows as $ row ) { $ tracks [ $ row [ 'gr2t_id_respondent_track' ] ] = $ this -> getRespondentTrack ( $ row ) ; } return $ tracks ; }
docstring: Get all tracks for a respondent
  
  Specify the optional $order to sort other than on start date
  
  @param int $respondentId
  @param int $organizationId
  @param mixed $order The column(s) and direction to order by
  @return \Gems_Tracker_RespondentTrack[]
docstring_tokens: Get all tracks for a respondent