DDC-2066: [GH-472] Fixed empty namespace in generated code when repository class do not have namespace #2747

Closed
doctrinebot opened this Issue Oct 11, 2012 · 4 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

This issue is created automatically through a Github pull request on behalf of twinh:

Url: #472

Message:

When we defined a class without namespace for entity repository, just like @Entity(repositoryClass="BugRepository"), EntityRepositoryGenerator will generate the code like blow, which has error statement in namespace definition. So this is mainly added a generateEntityRepositoryNamespace method to generate the correct namespace.Just like what EntityGenerator does
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/EntityGenerator.php#L492

before

<?php

namespace ; //caurse parse error: syntax error, unexpected ';', expecting T*STRING or T_NS*SEPARATOR or '{'

use Doctrine\ORM\EntityRepository;

/****
 * BugRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class BugRepository extends EntityRepository
{
}

after

<?php



use Doctrine\ORM\EntityRepository;

/****
 * BugRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class BugRepository extends EntityRepository
{
}
@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-472] was closed
#472

@doctrinebot

Comment created by @FabioBatSilva:

Merged : a16a935

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-472] was closed:
doctrine/dbal#472

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.4 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment