original_string: protected function setOrder(Select $query, array $order)
      {
          // Normalize to [['column', 'direction']] format if only one column
          if (! is_array(Arr::get($order, 0))) {
              $order = [$order];
          }
  
          foreach ($order as $key => $orderValue) {
              if (is_array($orderValue)) {
                  // Column and direction
                  $query->order(
                      Arr::get($orderValue, 0).' '.Arr::get($orderValue, 1)
                  );
              }
          }
  
          return $query;
      }
code: protected function setOrder(Select $query, array $order)
      {
          // Normalize to [['column', 'direction']] format if only one column
          if (! is_array(Arr::get($order, 0))) {
              $order = [$order];
          }
  
          foreach ($order as $key => $orderValue) {
              if (is_array($orderValue)) {
                  // Column and direction
                  $query->order(
                      Arr::get($orderValue, 0).' '.Arr::get($orderValue, 1)
                  );
              }
          }
  
          return $query;
      }
code_tokens: protected function setOrder ( Select $ query , array $ order ) { // Normalize to [['column', 'direction']] format if only one column if ( ! is_array ( Arr :: get ( $ order , 0 ) ) ) { $ order = [ $ order ] ; } foreach ( $ order as $ key => $ orderValue ) { if ( is_array ( $ orderValue ) ) { // Column and direction $ query -> order ( Arr :: get ( $ orderValue , 0 ) . ' ' . Arr :: get ( $ orderValue , 1 ) ) ; } } return $ query ; }
docstring: Set the order on the given query
  
  Can specify order as [['column', 'direction'], ['column', 'direction']]
  or just ['column', 'direction'] or even [['column', 'direction'], 'column']
  
  @param Select $query
  @param array  $order
  
  @return Select
docstring_tokens: Set the order on the given query