original_string: private function orderBy($order) {
          if(is_array($order) && !empty(array_filter($order))) {
              $string = array();
              foreach($order as $fieldorder => $fieldvalue) {
                  if(!empty($fieldorder) && !empty($fieldvalue)) {
                      $string[] = sprintf("`%s` %s", SafeString::makeSafe($fieldorder), strtoupper(SafeString::makeSafe($fieldvalue)));
                  }
                  elseif($fieldvalue === 'RAND()') {
                      $string[] = $fieldvalue;
                  }
              }
              return sprintf(" ORDER BY %s", implode(", ", $string));
          }
          elseif($order == 'RAND()') {
              return " ORDER BY RAND()";
          }
          return false;
      }
code: private function orderBy($order) {
          if(is_array($order) && !empty(array_filter($order))) {
              $string = array();
              foreach($order as $fieldorder => $fieldvalue) {
                  if(!empty($fieldorder) && !empty($fieldvalue)) {
                      $string[] = sprintf("`%s` %s", SafeString::makeSafe($fieldorder), strtoupper(SafeString::makeSafe($fieldvalue)));
                  }
                  elseif($fieldvalue === 'RAND()') {
                      $string[] = $fieldvalue;
                  }
              }
              return sprintf(" ORDER BY %s", implode(", ", $string));
          }
          elseif($order == 'RAND()') {
              return " ORDER BY RAND()";
          }
          return false;
      }
code_tokens: private function orderBy ( $ order ) { if ( is_array ( $ order ) && ! empty ( array_filter ( $ order ) ) ) { $ string = array ( ) ; foreach ( $ order as $ fieldorder => $ fieldvalue ) { if ( ! empty ( $ fieldorder ) && ! empty ( $ fieldvalue ) ) { $ string [ ] = sprintf ( "`%s` %s" , SafeString :: makeSafe ( $ fieldorder ) , strtoupper ( SafeString :: makeSafe ( $ fieldvalue ) ) ) ; } elseif ( $ fieldvalue === 'RAND()' ) { $ string [ ] = $ fieldvalue ; } } return sprintf ( " ORDER BY %s" , implode ( ", " , $ string ) ) ; } elseif ( $ order == 'RAND()' ) { return " ORDER BY RAND()" ; } return false ; }
docstring: Sets the order sting for the SQL query based on an array or string
  @param array|string $order This should be either set to array('fieldname' => 'ASC/DESC') or RAND()
  @return string|false If the SQL query has an valid order by will return a string else returns false
docstring_tokens: Sets the order sting for the SQL query based on an array or string