@@ -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