|
@@ -163,7 +163,7 @@ class AclQueryBuilder {
|
|
|
if ($this->from instanceof Core_AclBase) $sqlPk = $this->from->getSqlPrimaryKeyField();
|
|
if ($this->from instanceof Core_AclBase) $sqlPk = $this->from->getSqlPrimaryKeyField();
|
|
|
if ('*' === $select) return "{$this->_fromPrefix}.*";
|
|
if ('*' === $select) return "{$this->_fromPrefix}.*";
|
|
|
if ('@primaryKey' === $select) {
|
|
if ('@primaryKey' === $select) {
|
|
|
- return "{$this->_fromPrefix}.{$sqlPk} as `@primaryKey`";
|
|
|
|
|
|
|
+ return "{$this->_fromPrefix}.{$sqlPk} as " . $this->getPDO()->identifierQuote("@primaryKey");
|
|
|
}
|
|
}
|
|
|
if ('@instances' === $select) {
|
|
if ('@instances' === $select) {
|
|
|
if (!($this->from instanceof Core_AclBase)) throw new Exception("select @instances allowed only for Acl object");
|
|
if (!($this->from instanceof Core_AclBase)) throw new Exception("select @instances allowed only for Acl object");
|
|
@@ -172,7 +172,7 @@ class AclQueryBuilder {
|
|
|
// > foreach ($listInstanceConfig as $instanceConfig) {
|
|
// > foreach ($listInstanceConfig as $instanceConfig) {
|
|
|
// IF( ( select 1 from `{$instanceTable}` where ID = {$this->_fromPrefix}.{$sqlPk} ) > 0, '{$instanceName},', ''),
|
|
// IF( ( select 1 from `{$instanceTable}` where ID = {$this->_fromPrefix}.{$sqlPk} ) > 0, '{$instanceName},', ''),
|
|
|
// )
|
|
// )
|
|
|
- return " '' as `@instances` ";
|
|
|
|
|
|
|
+ return " '' as " . $this->getPDO()->identifierQuote("@instances");
|
|
|
}
|
|
}
|
|
|
if (is_array($select)) {
|
|
if (is_array($select)) {
|
|
|
// TODO: [ '__backRef' => [ ... ] ]
|
|
// TODO: [ '__backRef' => [ ... ] ]
|