DDC-3396: In Doctrine\ORM\Query\SqlWalker tableAliasMap and tableAliasCountershould be exposed #4195

Open
opened 2026-01-22 14:37:06 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 17, 2014).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user IoanBadila:

I see that Doctrine\ORM\Query\SqlWalker::tableAliasMap and tableAliasCounter are private properties but this doesn't scale well with public Doctrine\ORM\Query\SqlWalker::getSQLTableAlias($tableName, $dqlAlias = '')

public function getSQLTableAlias($tableName, $dqlAlias = '')
{
    $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : '';

    if ( ! isset($this->tableAliasMap[$tableName])) {
        $this->tableAliasMap[$tableName] = strtolower(substr($tableName, 0, 1)) . $this->tableAliasCounter<ins></ins> . '_';
    }

    return $this->tableAliasMap[$tableName];
}

For me, getSQLTableAlias() is useful in my custom walker but I can't actually use it without exposing tableAliasMap and tableAliasCounter.

Originally created by @doctrinebot on GitHub (Nov 17, 2014). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user IoanBadila: I see that Doctrine\ORM\Query\SqlWalker::tableAliasMap and tableAliasCounter are private properties but this doesn't scale well with public Doctrine\ORM\Query\SqlWalker::getSQLTableAlias($tableName, $dqlAlias = '') ``` public function getSQLTableAlias($tableName, $dqlAlias = '') { $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; if ( ! isset($this->tableAliasMap[$tableName])) { $this->tableAliasMap[$tableName] = strtolower(substr($tableName, 0, 1)) . $this->tableAliasCounter<ins></ins> . '_'; } return $this->tableAliasMap[$tableName]; } ``` For me, getSQLTableAlias() is useful in my custom walker but I can't actually use it without exposing tableAliasMap and tableAliasCounter.
admin added the Improvement label 2026-01-22 14:37:06 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4195