首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >给定的对象管理器不是由包装器管理的。

给定的对象管理器不是由包装器管理的。
EN

Stack Overflow用户
提问于 2018-09-10 20:46:22
回答 1查看 88关注 0票数 0

我正在努力使使用symfony2构建的一个旧的php项目工作。当我想要装载固定装置时:

代码语言:javascript
复制
php app/console doctrine:fixtures:load --env=test

我发现了一个错误:

代码语言:javascript
复制
[Gedmo\Exception\UnsupportedObjectManagerException]  
Given object manager is not managed by wrapper

完整的追踪:

代码语言:javascript
复制
# php app/console doctrine:fixtures:load --verbose
Careful, database will be purged. Do you want to continue Y/N ?y
  > purging database
  > loading [1] Muzich\UserBundle\DataFixtures\ORM\LoadUserData



  [Gedmo\Exception\UnsupportedObjectManagerException]  
  Given object manager is not managed by wrapper       



Exception trace:
 () at /muzich/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tool/Wrapper/AbstractWrapper.php:65
 Gedmo\Tool\Wrapper\AbstractWrapper::wrap() at /muzich/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Event/Adapter/ORM.php:26
 Gedmo\Sluggable\Mapping\Event\Adapter\ORM->getSimilarSlugs() at /muzich/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/SluggableListener.php:461
 Gedmo\Sluggable\SluggableListener->makeUniqueSlug() at /muzich/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/SluggableListener.php:402
 Gedmo\Sluggable\SluggableListener->generateSlug() at /muzich/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/SluggableListener.php:218
 Gedmo\Sluggable\SluggableListener->onFlush() at /muzich/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php:61
 Symfony\Bridge\Doctrine\ContainerAwareEventManager->dispatchEvent() at /muzich/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:306
 Doctrine\ORM\UnitOfWork->commit() at /muzich/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:355
 Doctrine\ORM\EntityManager->flush() at /muzich/src/Muzich/UserBundle/DataFixtures/ORM/LoadUserData.php:98
 Muzich\UserBundle\DataFixtures\ORM\LoadUserData->load() at /muzich/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/AbstractExecutor.php:121
 Doctrine\Common\DataFixtures\Executor\AbstractExecutor->load() at /muzich/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/ORMExecutor.php:83
 Doctrine\Common\DataFixtures\Executor\ORMExecutor->Doctrine\Common\DataFixtures\Executor\{closure}() at n/a:n/a
 call_user_func() at /muzich/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:223
 Doctrine\ORM\EntityManager->transactional() at /muzich/app/cache/dev/jms_diextra/doctrine/EntityManager_5b969a4da5b1d.php:31
 EntityManager5b969a4da5b1d_546a8d27f194334ee012bfe64f629947b07e4919\__CG__\Doctrine\ORM\EntityManager->transactional() at /muzich/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/ORMExecutor.php:85
 Doctrine\Common\DataFixtures\Executor\ORMExecutor->execute() at /muzich/vendor/doctrine/doctrine-fixtures-bundle/Command/LoadDataFixturesDoctrineCommand.php:105
 Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand->execute() at /muzich/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:242
 Symfony\Component\Console\Command\Command->run() at /muzich/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:200
 Symfony\Component\Console\Application->doRun() at /muzich/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:83
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /muzich/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:106
 Symfony\Component\Console\Application->run() at /muzich/app/console:16


doctrine:fixtures:load [--fixtures[="..."]] [--append] [--em="..."] [--purge-with-truncate]

源代码是这里。问题是什么?如何解决?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-09-13 20:41:22

使用v2.3.6版本的gedmo/doctrine-extensions解决了问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52265264

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档