yii\di\Container::hasSingleton PHP Метод

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

Returns a value indicating whether the given name corresponds to a registered singleton.
public hasSingleton ( string $class, boolean $checkInstance = false ) : boolean
$class string class name, interface name or alias name
$checkInstance boolean whether to check if the singleton has been instantiated.
Результат boolean whether the given name corresponds to a registered singleton. If `$checkInstance` is true, the method should return a value indicating whether the singleton has been instantiated.
    public function hasSingleton($class, $checkInstance = false)
    {
        return $checkInstance ? isset($this->_singletons[$class]) : array_key_exists($class, $this->_singletons);
    }