Symfony/Doctrine: Class is not a valid entity or mapped super class

前端 未结 2 544
一生所求
一生所求 2021-01-14 04:47

I\'m getting the \"Class PriceOrQuality\\POQBundle\\Entity\\Tag is not a valid entity or mapped super class error. I\'ve have checked all the answers to similar questions, b

相关标签:
2条回答
  • 2021-01-14 05:01

    Read up a bit on query builder. It's easier and different than a sql query. No need for join conditions.

    This (for starters):

    $qb->leftjoin('PriceOrQuality\POQBundle\Entity\Tag','t', 'WITH', 'et.tag = t.id');
    

    Should just be:

    $qb->leftJoin('et.tag','t');
    

    There might be more problems but that will get you started. http://docs.doctrine-project.org/en/latest/reference/query-builder.html

    0 讨论(0)
  • 2021-01-14 05:22

    Found the issue.

    I had a //@todo after the meta definition and before the class definition. Apparently that screwed up the mapping, as it was not mapped in doctrine.

    Moving the //@todo and rerunning the mapping fixed the problem.

    For whomever finds this question with similar problems try running:

    php app/console doctrine:mapping:info
    

    It will show you if you have problems in the mapping structure in doctrine

    Thanks for your time guys.

    Cheers, Rune

    0 讨论(0)
提交回复
热议问题