- Added identifier escaping to match differents PDO drivers

This commit is contained in:
Dave Mc Nicoll committed 2020-04-09 13:20:07 -04:00
1 parent def8decb4e
commit 3ff97f3bf0
8 files changed
+71 -30

No files matched your search

+4 -2
View File
@@ -3,6 +3,7 @@
namespace Ulmus\Common;
use Ulmus\Ulmus,
Ulmus\Adapter\AdapterInterface,
Ulmus\Annotation\Property\Field;
class EntityField
@@ -27,8 +28,9 @@ class EntityField
{
$name = $this->entityResolver->searchFieldAnnotation($this->name, new Field() )->name ?? $this->name;
#return $useAlias ? "{$this->alias}.`{$this->name}`" : "`{$this->name}`"; <-SQL
return $useAlias ? "{$this->alias}.\"{$name}\"" : "\"{$name}\"";
$name = ( $this->entityResolver->databaseAdapter() ?? Ulmus::$defaultAdapter )->adapter()->escapeIdentifier($name, AdapterInterface::IDENTIFIER_FIELD);
return $useAlias ? "{$this->alias}.$name" : $name;
}
public static function isScalarType($type) : bool