3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\ServiceManager\Exception
;
12 use Exception
as BaseException
;
13 use Zend\ServiceManager\AbstractPluginManager
;
14 use Zend\ServiceManager\ServiceLocatorInterface
;
16 class ServiceLocatorUsageException
extends ServiceNotFoundException
21 * @param AbstractPluginManager $pluginManager
22 * @param ServiceLocatorInterface $parentLocator
23 * @param string $serviceName
24 * @param BaseException $previousException
28 public static function fromInvalidPluginManagerRequestedServiceName(
29 AbstractPluginManager
$pluginManager,
30 ServiceLocatorInterface
$parentLocator,
32 BaseException
$previousException
36 "Service \"%s\" has been requested to plugin manager of type \"%s\", but couldn't be retrieved.\n"
37 . "A previous exception of type \"%s\" has been raised in the process.\n"
38 . "By the way, a service with the name \"%s\" has been found in the parent service locator \"%s\": "
39 . 'did you forget to use $parentLocator = $serviceLocator->getServiceLocator() in your factory code?',
41 get_class($pluginManager),
42 get_class($previousException),
44 get_class($parentLocator)