Sfoglia il codice sorgente

Allow aliasing columns when using the query builder

Signed-off-by: Robin Appelman <robin@icewind.nl>
tags/v11.0RC2
Robin Appelman 7 anni fa
parent
commit
07e51a719a
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5
    0
      lib/private/DB/QueryBuilder/QuoteHelper.php

+ 5
- 0
lib/private/DB/QueryBuilder/QuoteHelper.php Vedi File

@@ -61,6 +61,11 @@ class QuoteHelper {
throw new \InvalidArgumentException('Only strings, Literals and Parameters are allowed');
}

$string = str_replace(' AS ', ' as ', $string);
if (substr_count($string, ' as ')) {
return implode(' as ', array_map([$this, 'quoteColumnName'], explode(' as ', $string, 2)));
}

if (substr_count($string, '.')) {
list($alias, $columnName) = explode('.', $string, 2);


Loading…
Annulla
Salva