original_string: public function get_records_sql_menu($sql, array $params=null, $limitfrom=0, $limitnum=0) {
          $menu = array();
          if ($records = $this->get_records_sql($sql, $params, $limitfrom, $limitnum)) {
              foreach ($records as $record) {
                  $record = (array)$record;
                  $key   = array_shift($record);
                  $value = array_shift($record);
                  $menu[$key] = $value;
              }
          }
          return $menu;
      }
code: public function get_records_sql_menu($sql, array $params=null, $limitfrom=0, $limitnum=0) {
          $menu = array();
          if ($records = $this->get_records_sql($sql, $params, $limitfrom, $limitnum)) {
              foreach ($records as $record) {
                  $record = (array)$record;
                  $key   = array_shift($record);
                  $value = array_shift($record);
                  $menu[$key] = $value;
              }
          }
          return $menu;
      }
code_tokens: public function get_records_sql_menu ( $ sql , array $ params = null , $ limitfrom = 0 , $ limitnum = 0 ) { $ menu = array ( ) ; if ( $ records = $ this -> get_records_sql ( $ sql , $ params , $ limitfrom , $ limitnum ) ) { foreach ( $ records as $ record ) { $ record = ( array ) $ record ; $ key = array_shift ( $ record ) ; $ value = array_shift ( $ record ) ; $ menu [ $ key ] = $ value ; } } return $ menu ; }
docstring: Get the first two columns from a number of records as an associative array using a SQL statement.
  
  Arguments are like {@link function get_recordset_sql}.
  Return value is like {@link function get_records_menu}.
  
  @param string $sql The SQL string you wish to be executed.
  @param array $params array of sql parameters
  @param int $limitfrom return a subset of records, starting at this point (optional).
  @param int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
  @return array an associative array
  @throws dml_exception A DML specific exception is thrown for any errors.
docstring_tokens: Get the first two columns from a number of records as an associative array using a SQL statement .