Symfony\Component\DependencyInjection\ContainerInterface::hasScope PHP Method

hasScope() public method

Whether this container has the given scope
public hasScope ( string $name ) : boolean
$name string
return boolean
    function hasScope($name);

Usage Example

 /**
  * Adds the Contao scopes to the container.
  */
 private function addContaoScopesIfNotSet()
 {
     if (!$this->container->hasScope(ContaoCoreBundle::SCOPE_BACKEND)) {
         $this->container->addScope(new Scope(ContaoCoreBundle::SCOPE_BACKEND, 'request'));
     }
     if (!$this->container->hasScope(ContaoCoreBundle::SCOPE_FRONTEND)) {
         $this->container->addScope(new Scope(ContaoCoreBundle::SCOPE_FRONTEND, 'request'));
     }
 }
All Usage Examples Of Symfony\Component\DependencyInjection\ContainerInterface::hasScope