DDC-636: Incorrect proxy name when using alias for entity namespace #788

Closed
opened 2026-01-22 12:50:31 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 13, 2010).

Jira issue originally created by user majkl578:

When I create an alias for entity namespace:

$config->setEntityNamespaces(array(
    'Entities' => 'A\B\Entities',
));

and then use it in association mapping:

/****
 * @ManyToOne(targetEntity="Entities:Foo\Bar")
 */
private $bar;

Then the proxy for the target entity is not generated correctly. It generates proxy class name "Entities:Foo\BarProxy", instead of "ABEntitiesFooBarProxy". It obviously causes Parse error in PHP.

Originally created by @doctrinebot on GitHub (Jun 13, 2010). Jira issue originally created by user majkl578: When I create an alias for entity namespace: ``` $config->setEntityNamespaces(array( 'Entities' => 'A\B\Entities', )); ``` and then use it in association mapping: ``` /**** * @ManyToOne(targetEntity="Entities:Foo\Bar") */ private $bar; ``` Then the proxy for the target entity is not generated correctly. It generates proxy class name "Entities:Foo\BarProxy", instead of "ABEntitiesFooBarProxy". It obviously causes Parse error in PHP.
admin added the Bug label 2026-01-22 12:50:31 +01:00
admin closed this issue 2026-01-22 12:50:32 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 13, 2010):

Comment created by @beberlei:

Aliases in targetEntity are not supported and can't be architecture-wise. Aliases only work in DQL Queries or for EntityManager::find() ::getRepository().

@doctrinebot commented on GitHub (Jun 13, 2010): Comment created by @beberlei: Aliases in targetEntity are not supported and can't be architecture-wise. Aliases only work in DQL Queries or for EntityManager::find() ::getRepository().
Author
Owner

@doctrinebot commented on GitHub (Jun 13, 2010):

Issue was closed with resolution "Can't Fix"

@doctrinebot commented on GitHub (Jun 13, 2010): Issue was closed with resolution "Can't Fix"
Author
Owner

@doctrinebot commented on GitHub (Oct 28, 2013):

Comment created by nick4fake:

Why this bug is set to "Won't fix"? It would be great feature.

@doctrinebot commented on GitHub (Oct 28, 2013): Comment created by nick4fake: Why this bug is set to "Won't fix"? It would be great feature.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#788