This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
Undefined method "->getServiceLocator()" in IdentityFactory #4464
Comments
That won't work. The problem here is that |
Then check the given variable can be a solution, or? if ($serviceLocator instanceof ServiceLocatorAwareInterface) {
$serviceLocator = $serviceLocator->getServiceLocator();
} In my case $serviceLocator is a object of service manager. Did i do something wrong? 'service_manager' => array(
'factories' => array(
'Identity' => 'Zend\Mvc\Controller\Plugin\Service\IdentityFactory',
),
), |
That's surely a good idea to have some type hinting and avoid this typical question. Anyway, this plugin's factory can be used only in a plugin manager right now. |
@dragonprojects @Ocramius is this now a question or a suggestion? When it's a question -> can this get closed? |
ping @dragonprojects |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In "Zend\Mvc\Controller\Plugin\Service\IdentityFactory" is following Line:
But the $serviceLocator has no method "getServiceLocator", the object is the service locator.
So this implementation would be correct:
The text was updated successfully, but these errors were encountered: