Returns the instance associated with the supplied alias.

@param string $alias
@return object|boolean
352629
public function get($alias)
    {
        if (!isset($this->registered[$alias]))
            return false;
        
        // Does an instance exist for this alias?
        if (isset($this->instance[$alias]) && is_object($this->instance[$alias]))
            return $this->instance[$alias];
        
        // Execute the Closure to get the first instance
        $this->instance[$alias] = $this->registered[$alias]($this);
        if (!is_object($this->instance[$alias]))
            throw new Exception('The alias "' . $alias . '" does not return an object.');
        
        return $this->instance[$alias];
    }
534332
protected function resolveAlias($alias)
	{
		if (!empty($this->aliases[$alias]))
		{
			return $this->aliases[$alias];
		}

		return $alias;
	}
1244140
public function load(string $alias): ?bool
    {
        if (\strpos($alias, self::FACADE_NAMESPACE) === 0) {
            return $this->loadFacade($alias);
        }

        if (isset($this->aliases[$alias])) {
            return \class_alias($this->aliases[$alias], $alias);
        }

        return null;
    }
837351
public static function clear($alias = null)
	{
		$obj = self::getInstance($alias);
		if ($obj)
		{
			return $obj->clear();
		}
		else
		{
			return false;
		}
	}
740750
public function get($alias, array $args = [])
    {
        $alias    = $this->inflectClassName($alias);
        $instance = NULL;

        // If we already have a shared instance, return it now
        if ( array_key_exists($alias, $this->sharedInstances) ) {
            return $this->sharedInstances[ $alias ];
        }

        // If we have an alias for this class get that
        if ( array_key_exists($alias, $this->aliases) ) {
            $instance = $this->get($this->aliases[ $alias ], $args);
        }

        // If the class is a callable
        if ( array_key_exists($alias, $this->callables) ) {
            $instance = $this->call($alias, $args);
        }


        // If we don't have an instance, create it now
        if ( !$instance ) {
            $instance = parent::get($alias, $args);
        }

        // If we should store a copy of this instance, do it now
        if ( in_array($alias, $this->toShare) ) {
            $this->sharedInstances[ $alias ] = $instance;
        }

        return $instance;
    }
178590
public function getWasConverterUsed($alias = null)
    {
        if ($alias) {
            return isset($this->converterAliasUsed[$alias]) ? $this->converterAliasUsed[$alias] : false;
        } else {
            return $this->converterUsed;
        }
    }
791334
public function single($alias)
	{
		$alias = strtolower($alias);

		// Return the existing object if it exists.
		if (! empty($this->instances[$alias]) && is_object($this->instances[$alias]))
		{
			return $this->instances[$alias];
		}

		// Die if we don't know what class to use.
		if (empty($this->services[$alias]))
		{
			throw new \InvalidArgumentException('Unable to find class with alias: '. $alias);
		}

		$instance = $this->make($alias, true);

		$this->instances[$alias] =& $instance;

		return $this->instances[$alias];
	}
322652
public static function instanceExists($alias = null)
	{
		if('' === static::$driverName)
		{
			static::init();
		}
		return isset(self::$instances[static::$driverName][null === $alias ? self::defaultAlias() : $alias]);
	}
820929
public static function getAlias($alias)
    {
        $alias = strtolower($alias);

        return array_key_exists($alias, self::$aliases) ? self::$aliases[$alias] : false;
    }
832145
public function getStaffByAlias($alias) {
        $access = $this->getByAlias($alias);

        return $this->find('all', array(
            'conditions' => array(
                'RequestObject.parent_id' => $access['RequestObject']['id'],
                'RequestObject.foreign_key !=' => null,
                'RequestObject.model' => USER_MODEL
            ),
            'contain' => array('User', 'Parent'),
            'cache' => array(__METHOD__, $alias)
        ));
    }
776065
public function alias($alias)
    {
        $alias = (string)$alias;
        if (in_array($alias, $this->with)) {
            throw new \InvalidArgumentException("Cannot use alias '{$alias}' because a relation already uses it");
        }

        $this->alias = $alias;

        return $this;
    }
1008846
public function getConfiguration($alias)
    {
        if (array_key_exists($alias, $this->searchConfigurations)) {
            return $this->searchConfigurations[$alias];
        }

        return null;
    }
844425
public function hasSubqueryAlias($alias)
    {
        return $this->hasAlias($alias) && $this->getExpression($this->getHash($alias)) instanceof Expr\Subquery;
    }
923571
public function getAuthorize($alias)
    {
        if (empty($this->_authorizeObjects)) {
            $this->constructAuthorize();
        }

        return isset($this->_authorizeObjects[$alias]) ? $this->_authorizeObjects[$alias] : null;
    }
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]);
    }
580095
public static function getInstance($refresh = false)
    {
        if (is_null(self::$environment) || $refresh) {
            self::$environment = new self();
        }

        return self::$environment;
    }
211642
static function get($alias = null)
    {
        if ($alias === null) {
            return static::$config[static::$default];
        }
        if (isset(static::$config[$alias])) {
            return static::$config[$alias];
        } else {
            return false;
        }
    }