original_string: private function get_limit_sql($sql, array $params = null, $limitfrom=0, $limitnum=0) {
  
          list($limitfrom, $limitnum) = $this->normalise_limit_from_num($limitfrom, $limitnum);
          // TODO: Add the /*+ FIRST_ROWS */ hint if there isn't another hint
  
          if ($limitfrom and $limitnum) {
              $sql = "SELECT oracle_o.*
                        FROM (SELECT oracle_i.*, rownum AS oracle_rownum
                                FROM ($sql) oracle_i
                               WHERE rownum <= :oracle_num_rows
                              ) oracle_o
                       WHERE oracle_rownum > :oracle_skip_rows";
              $params['oracle_num_rows'] = $limitfrom + $limitnum;
              $params['oracle_skip_rows'] = $limitfrom;
  
          } else if ($limitfrom and !$limitnum) {
              $sql = "SELECT oracle_o.*
                        FROM (SELECT oracle_i.*, rownum AS oracle_rownum
                                FROM ($sql) oracle_i
                              ) oracle_o
                       WHERE oracle_rownum > :oracle_skip_rows";
              $params['oracle_skip_rows'] = $limitfrom;
  
          } else if (!$limitfrom and $limitnum) {
              $sql = "SELECT *
                        FROM ($sql)
                       WHERE rownum <= :oracle_num_rows";
              $params['oracle_num_rows'] = $limitnum;
          }
  
          return array($sql, $params);
      }
code: private function get_limit_sql($sql, array $params = null, $limitfrom=0, $limitnum=0) {
  
          list($limitfrom, $limitnum) = $this->normalise_limit_from_num($limitfrom, $limitnum);
          // TODO: Add the /*+ FIRST_ROWS */ hint if there isn't another hint
  
          if ($limitfrom and $limitnum) {
              $sql = "SELECT oracle_o.*
                        FROM (SELECT oracle_i.*, rownum AS oracle_rownum
                                FROM ($sql) oracle_i
                               WHERE rownum <= :oracle_num_rows
                              ) oracle_o
                       WHERE oracle_rownum > :oracle_skip_rows";
              $params['oracle_num_rows'] = $limitfrom + $limitnum;
              $params['oracle_skip_rows'] = $limitfrom;
  
          } else if ($limitfrom and !$limitnum) {
              $sql = "SELECT oracle_o.*
                        FROM (SELECT oracle_i.*, rownum AS oracle_rownum
                                FROM ($sql) oracle_i
                              ) oracle_o
                       WHERE oracle_rownum > :oracle_skip_rows";
              $params['oracle_skip_rows'] = $limitfrom;
  
          } else if (!$limitfrom and $limitnum) {
              $sql = "SELECT *
                        FROM ($sql)
                       WHERE rownum <= :oracle_num_rows";
              $params['oracle_num_rows'] = $limitnum;
          }
  
          return array($sql, $params);
      }
code_tokens: private function get_limit_sql ( $ sql , array $ params = null , $ limitfrom = 0 , $ limitnum = 0 ) { list ( $ limitfrom , $ limitnum ) = $ this -> normalise_limit_from_num ( $ limitfrom , $ limitnum ) ; // TODO: Add the /*+ FIRST_ROWS */ hint if there isn't another hint if ( $ limitfrom and $ limitnum ) { $ sql = "SELECT oracle_o.*
                        FROM (SELECT oracle_i.*, rownum AS oracle_rownum
                                FROM ($sql) oracle_i
                               WHERE rownum <= :oracle_num_rows
                              ) oracle_o
                       WHERE oracle_rownum > :oracle_skip_rows" ; $ params [ 'oracle_num_rows' ] = $ limitfrom + $ limitnum ; $ params [ 'oracle_skip_rows' ] = $ limitfrom ; } else if ( $ limitfrom and ! $ limitnum ) { $ sql = "SELECT oracle_o.*
                        FROM (SELECT oracle_i.*, rownum AS oracle_rownum
                                FROM ($sql) oracle_i
                              ) oracle_o
                       WHERE oracle_rownum > :oracle_skip_rows" ; $ params [ 'oracle_skip_rows' ] = $ limitfrom ; } else if ( ! $ limitfrom and $ limitnum ) { $ sql = "SELECT *
                        FROM ($sql)
                       WHERE rownum <= :oracle_num_rows" ; $ params [ 'oracle_num_rows' ] = $ limitnum ; } return array ( $ sql , $ params ) ; }
docstring: Transforms the sql and params in order to emulate the LIMIT clause available in other DBs
  
  @param string $sql the SQL select query to execute.
  @param array $params array of sql parameters
  @param int $limitfrom return a subset of records, starting at this point (optional, required if $limitnum is set).
  @param int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
  @return array with the transformed sql and params updated
docstring_tokens: Transforms the sql and params in order to emulate the LIMIT clause available in other DBs