The method name must start with either findBy or findOneBy. Undefined method Symfony?

前端 未结 8 1997
梦谈多话
梦谈多话 2020-11-27 05:22

I am working through part4 of Symfony2, and while updating the controller and helper class code i got the following error message

Undefined method \'getLates         


        
相关标签:
8条回答
  • 2020-11-27 06:13

    In my case adding proper annotation was insufficient.
    Deleting Doctrine Cache by php app/console doctrine:cache:clear-metadata also not worked.

    I generate my entities from database by commands

    php app/console doctrine:mapping:import --force AcmeBlogBundle xml
    php app/console doctrine:mapping:convert annotation ./src
    php app/console doctrine:generate:entities AcmeBlogBundle

    First command generate orm.xml file for each DB Table in my project. After DELETING all orm.xml files Annotations started work properly.

    0 讨论(0)
  • 2020-11-27 06:16

    For me it helped to restart my vm (Vagrant Box)

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