Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 3 comments

1 participant

@doctrinebot

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.

@doctrinebot

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

Issue was closed with resolution "Can't Fix"

@doctrinebot

Comment created by nick4fake:

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

@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.