Check if alias points to constructed instance (singleton).

@param string $alias
@return bool
504117
final public function hasInstance(string $alias): bool
    {
        if (!$this->has($alias)) {
            return false;
        }

        while (isset($this->bindings[$alias]) && is_string($this->bindings[$alias])) {
            //Checking alias tree
            $alias = $this->bindings[$alias];
        }

        return isset($this->bindings[$alias]) && is_object($this->bindings[$alias]);
    }
1149539
public function isDrushAliasValid($alias) {
    $bin = $this->getConfigValue('composer.bin');
    $command = "'$bin/drush' site:alias @$alias --format=json";
    return $this->executor->execute($command)
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERY_VERBOSE)
      ->run()
      ->wasSuccessful();
  }
238008
public function alias(string $alias): AliasInterface
    {
        if (!in_array($alias, $this->alias)) {
            $this->alias[] = $alias;
        }
        $this->aliasHelper($alias);

        return $this;
    }
1331001
public static function getInstance($alias = null)
	{
		if('' === static::$driverName)
		{
			static::init();
		}
		if(null === $alias)
		{
			$alias = self::defaultAlias();
		}
		if (isset(self::$instances[static::$driverName][$alias]))
		{
			return self::$instances[static::$driverName][$alias];
		}
		else
		{
			$option = Config::get('@.APP_' . strtoupper(static::$driverName) . '.' . $alias);
			if(false === $option)
			{
				return null;
			}
			else
			{
				return self::create($option,$alias);
			}
		}
	}
573815
public function exists($alias)
    {
        $repo = $this->getItemsName();
        $loc = &$this->$repo;
        foreach (explode('.', $alias) as $step) {
            if (!isset($loc[$step])) {
                return false;
            } else {
                $loc = &$loc[$step];
            }
        }
        return true;
    }
712961
public function resolveClassAlias($alias)
    {
        $alias = static::normalise($alias);

        if (isset($this->classAliases[$alias])) {
            return $this->classAliases[$alias];
        }

        return $alias;
    }
53122
public function hasTableAlias($alias)
    {
        return $this->hasAlias($alias) && $this->getExpression($this->getHash($alias)) instanceof Expr\Table;
    }
1039377
public function globalise($alias = null)
    {
        if (!is_null($alias)){
            if (substr($alias, 0, 1) != '\\')
                $alias = '\\' . $alias;
            if (class_exists($alias))
                throw new \Exception('Class already exists!');
            class_alias(get_class($this), $alias);
        }
        self::$instance = $this;
    }
566520
public function isQueued(string $alias): bool
    {
        $query = $this->createQueryBuilder('c')
            ->where('c.alias = :alias')
            ->andWhere('c.ended is NULL')
            ->setParameter('alias', $alias)
            ->getQuery();

        try {
            $result = $query->setMaxResults(1)->getOneOrNullResult();
            if ($result) {
                return true;
            }
        } catch (NonUniqueResultException $e) {
            return false;
        }

        return false;
    }
1106588
public function translationExists($lang, $alias) {
		$tree = $this->getTree($lang);

		foreach ($tree as $branch) {
			if (isset($branch[$alias])) return true;
		}
		return false;
	}
1179383
public function Factory($Alias, $Args = NULL) {
      //if (!$this->Exists($Alias))
      if (!array_key_exists($Alias, $this->_Objects))
         return NULL;
      
      $Def = &$this->_Objects[$Alias];
      $ClassName = $Def['ClassName'];
      
      // Make sure the class has beeen included.
      if (!class_exists($ClassName)) {
         $Path = $Def['Path'];
         if (substr($Path, 0, 1) == '~') {
            // Replace the beginning of the path with the root of the application.
            $Path = PATH_ROOT . substr($Path, 1);
            $Def['Path'] = $Path;
         }
         
         if (file_exists($Path))
            require_once($Path);
      }
      
      if (!class_exists($ClassName, FALSE)) {
         throw new Exception(sprintf('Class %s not found while trying to get an object for %s. Check the path %s.', $ClassName, $Alias, $Def['Path']));
      }
      
      // Create the object differently depending on the type.
      $Result = NULL;
      $FactoryType = $Def['FactoryType'];
      $FactorySupplimentData = isset($Def[$FactoryType]) ? $Def[$FactoryType] : NULL;
      switch($FactoryType) {
         case Gdn::FactoryInstance:
            // Instantiate a new instance of the class.
            $Result = $this->_InstantiateObject($Alias, $ClassName, $Args);
            break;
         case Gdn::FactoryPrototype:
            $Prototype = $FactorySupplimentData;
            $Result = clone $Prototype;
            break;
         case Gdn::FactorySingleton:
            $SingletonDef = $FactorySupplimentData;
            if(is_array($SingletonDef)) {
               // The singleton has arguments for instantiation.
               $Singleton = NULL;
               $Args = $SingletonDef;
            } else {
               $Singleton = $SingletonDef;
            }
            
            if(is_null($Singleton)) {
               // Lazy create the singleton instance.
               $Singleton = $this->_InstantiateObject($Alias, $ClassName, $Args);
               $Def[$FactoryType] = $Singleton;
            }
            $Result = $Def[$FactoryType];
            break;
         case Gdn::FactoryRealSingleton:
            $RealSingletonDef = $FactorySupplimentData;
            
            // Not yet stored as an object... need to instantiate
            if (!is_object($RealSingletonDef)) {
               $RealSingleton = NULL;
            } else {
               $RealSingleton = $RealSingletonDef;
            }
            
            if (is_null($RealSingleton)) {
               // Lazy create the singleton instance.
               $RealSingleton = call_user_func_array(array($ClassName,$RealSingletonDef), $Args);
               $this->_SetDependancies($Alias, $RealSingleton);
               $Def[$FactoryType] = $RealSingleton;
            }
            $Result = $Def[$FactoryType];
            break;
         default:
            /** @todo Throw an exception. */
            throw new Exception();
            break;
      }
      return $Result;
   }
282928
public function useFramework($alias){
		if(!isset($this->controller)){
			return false;
			}
		$this->controller->frameworks[$alias]=$alias;
		return true;
		}
1055327
public function resolveAlias($alias)
	{
		// Check if alias exists in the store and as an object
		if (isset($this->aliases[$alias]) and $this->objectExists($this->aliases[$alias], true))
		{
			return $this->aliases[$alias];
		}

		return false;
	}
177248
public function getDomain($alias) {
		if (isset($this->aliases[$alias])) {
			return $this->aliases[$alias];
		}
		return $alias;
	}
194321
function isExtendedService($alias)
    {
        $cAlias = $this->_normalizeName($alias);
        return isset($this->aliases[$cAlias]);
    }
1348712
private function validateUnique(Alias $alias, LifecycleEventArgs $args)
    {
        return (bool) $args->getObjectManager()
            ->getRepository('ClasticAliasBundle:Alias')
            ->findBy(array(
                'alias' => $alias->getAlias(),
            ));
    }
584209
public function getAlias($alias)
    {
        return isset($this->_aliases[$alias]) ? $this->_aliases[$alias] : $alias;
    }