Closed thestanislav closed 10 years ago
Workaround for now:
`zfcuser_doctrine_em` => function ($sl) { return $sl->get('doctrine.entitymanager.orm_default'); }
Please give it a try and let me know.
Aliasing Doctrine\ORM\EntityManager
should also work
I see two suggestions for solving this problem, but I have no idea on how to proceed. Where (in what files) can I try these solutions? in zfcuser.global.php (tried that) or some other file. Alternatively does someone know what versions (of this module and zfcUser) to use to avoid the updated Doctrine module?
@UBy use 0.7 of the doctrine modules, which are STABLE.
If you use master, you'll always get into such problems
@Ocramius - Thanks that solved my problem.
Any updates?
The aliased service should be Doctrine\ORM\EntityManager
. Once the alias is changed, this should work again.
Some info for newbies.
Open file module/Application/config/module.config.php and find key service_manager->aiases
. Add 'zfcuser_doctrine_em' => 'Doctrine\ORM\EntityManager'
. Mine looks like this:
'service_manager' => array(
'abstract_factories' => array(
'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
'Zend\Log\LoggerAbstractServiceFactory',
),
'aliases' => array(
'translator' => 'MvcTranslator',
'zfcuser_doctrine_em' => 'Doctrine\ORM\EntityManager', // Line added to fix this issue
),
'factories' => array(
'navigation' => 'Zend\Navigation\Service\DefaultNavigationFactory',
),
),
Thanks @jaroslavas - This did the trick
@jaroslavas Thank you very much!
My module/Application/config/module.config.php ended up looking like this with ZF2 2.2 fresh install (after following the skeleton tutorial).
...
'service_manager' => array(
'factories' => array(
'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
'navigation' => 'Zend\Navigation\Service\DefaultNavigationFactory',
),
'aliases' => array(
'zfcuser_doctrine_em' => 'Doctrine\ORM\EntityManager', // added to fix dodgy ZfcUser/Doctrine integration
),
),
...
fixed in #69
zfcuser_doctrine_em service, alias of doctrine.entitymanager.orm_default is not available after recent service creation refactor of DoctrineModule