Skip to content

Commit e604f43

Browse files
authored
Merge pull request #122 from skipperbent/v4-development
Version 4.12.1
2 parents aec1af5 + 38b84c9 commit e604f43

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Pecee/Pixie/QueryBuilder/Adapters/BaseAdapter.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ abstract class BaseAdapter
6464
* Alias prefix
6565
* @var string|null
6666
*/
67-
protected $prefix;
67+
protected $aliasPrefix;
6868

6969
/**
7070
* BaseAdapter constructor.
@@ -138,8 +138,8 @@ protected function buildCriteria(array $statements, bool $bindValues = true): ar
138138
$key = $statement['key'];
139139

140140
// Add alias non-existing
141-
if($this->prefix !== null && strpos($key, '.') === false) {
142-
$key = $this->prefix . '.' . $key;
141+
if($this->aliasPrefix !== null && strpos($key, '.') === false) {
142+
$key = $this->aliasPrefix . '.' . $key;
143143
}
144144

145145
$key = $this->wrapSanitizer($key);
@@ -334,9 +334,9 @@ protected function concatenateQuery(array $pieces): string
334334
*/
335335
protected function buildAliasedTableName(string $table, array $statements): string
336336
{
337-
$prefix = $statements['aliases'][$table] ?? null;
338-
if ($prefix !== null) {
339-
return sprintf('%s AS %s', $this->wrapSanitizer($table), $this->wrapSanitizer(strtolower($prefix)));
337+
$this->aliasPrefix = $statements['aliases'][$table] ?? null;
338+
if ($this->aliasPrefix !== null) {
339+
return sprintf('%s AS %s', $this->wrapSanitizer($table), $this->wrapSanitizer(strtolower($this->aliasPrefix)));
340340
}
341341

342342
return sprintf('%s', $this->wrapSanitizer($table));

0 commit comments

Comments
 (0)