Dumplie\SharedKernel\Application\ServiceLocator::has PHP Метод

has() публичный Метод

public has ( string $id ) : boolean
$id string
Результат boolean
    public function has($id);

Usage Example

Пример #1
0
 /**
  * @param ServiceLocator $serviceLocator
  * @throws ServiceNotFoundException
  */
 public function boot(ServiceLocator $serviceLocator)
 {
     if (!$serviceLocator->has(Services::KERNEL_TRANSACTION_FACTORY)) {
         throw new ServiceNotFoundException(sprintf('Service with id "%s" is missing in service locator.', Services::KERNEL_TRANSACTION_FACTORY));
     }
     $serviceLocator->get(Services::KERNEL_COMMAND_EXTENSION_REGISTRY)->register(new TransactionExtension($serviceLocator->get(Services::KERNEL_TRANSACTION_FACTORY)), -1024);
 }
ServiceLocator