Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-636

Incorrect proxy name when using alias for entity namespace

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Can't Fix
    • Affects Version/s: 2.2, 2.3, 2.4
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      Debian, Ubuntu, PHP 5.5

      Description

      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.

        Activity

        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - Aliases in targetEntity are not supported and can't be architecture-wise. Aliases only work in DQL Queries or for EntityManager::find() ::getRepository().
        Hide
        Bogdan Yurov added a comment -

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

        Show
        Bogdan Yurov added a comment - Why this bug is set to "Won't fix"? It would be great feature.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Michael Moravec
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: