symfony doctrine gedmo extension:未定义的方法' getEntityManager'。方法名称必须以findBy或findOneBy开头

时间:2015-07-14 22:32:30

标签: php symfony doctrine-orm doctrine updates

在我的symfony2应用程序(2.6.9)中,使用doctrine扩展名gedmo 2.3.12,我有一个刚出现的错误。 它似乎是一个供应商问题,但我还没有找到解决方案。 我从symfony 2.7.2恢复到2.6.9,从gedmo 2.4.2恢复到2.3.12,但错误仍然存​​在。

有什么想法吗?

我的调试堆栈:

  

未定义的方法' getEntityManager'。方法名称必须以   要么是findBy,要么是findOneBy! 500内部服务器错误 -   BadMethodCallException

tack Trace
in vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php at line 226   -
                break;
            default:
                throw new \BadMethodCallException(
                    "Undefined method '$method'. The method name must start with ".
                    "either findBy or findOneBy!"
                );
at EntityRepository ->__call ('getEntityManager', array()) 
in vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php at line 123   + 
at NestedTreeRepository ->__call ('getEntityManager', array()) 
in vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/AbstractTreeRepository.php at line 65   + 
at ObjectCategoryRepository ->getEntityManager () 
in vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/AbstractTreeRepository.php at line 65   + 
at AbstractTreeRepository ->getQueryBuilder () 
in vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php at line 198   + 
at NestedTreeRepository ->childrenQueryBuilder (object(ObjectCategory), false, null, 'ASC', false) 
in vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php at line 269   + 
at NestedTreeRepository ->childrenQuery (object(ObjectCategory), false, null, 'ASC', false) 
in vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php at line 277   + 
at NestedTreeRepository ->children (object(ObjectCategory)) 
in src/AppBundle/Application/Core/CategoryManager.php at line 351   + 
at CategoryManager ->getNonParentCategoriesQueryBuilder ('AppBundle:Core\ObjectCategory', 'emploi') 
in src/AppBundle/Form/Job/JobSeekerType.php at line 75   + 
at JobSeekerType ->buildForm (object(OrderedFormBuilder), array('block_name' => null, 'disabled' => false, 'label' => null, 'label_format' => null, 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'required' => true, 'read_only' => false, 'max_length' => null, 'pattern' => null, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'virtual' => null, 'compound' => true, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'error_mapping' => array(), 'cascade_validation' => true, 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'csrf_provider' => object(CsrfProviderAdapter), 'intention' => null, 'attr' => array(), 'data_class' => 'AppBundle\Entity\Job\JobSeeker', 'empty_data' => object(Closure), 'error_bubbling' => true, 'label_attr' => array(), 'inherit_data' => false, 'validation_groups' => array('jobseeker', 'Default'), 'constraints' => array(), 'csrf_token_manager' => object(CsrfProviderAdapter), 'csrf_token_id' => null, 'position' => null)) 
in vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php at line 135   + 

编辑: 我在很多页面上都有错误。绝对是供应商问题。

1 个答案:

答案 0 :(得分:0)

找到它,

无缘无故,getEntityManager方法已从我的供应商类EntityRepository注释掉。

放回去解决了这个问题。