Produces the object from an alias
@param string $alias
@param mixed|string $fallback
@return mixed
@throws ItemNotFoundException
@throws \Exception
185986
protected function produceDependency($alias, $fallback = '_michaels_no_fallback')
    {
        /* Get the registered factory (string, closure, object, container, NoItemFoundMessage) */
        $factory = $this->getIfExists("$alias");

        /* Manage not founds and fallback */
        if ($factory instanceof NoItemFoundMessage) {
            if ($fallback !== '_michaels_no_fallback') {
                return $fallback;
            } elseif (class_exists($alias)) {
                return new $alias;
            } else {
                throw new ItemNotFoundException("$alias not found");
            }
        }

        /* Get any declared dependencies */
        $declared = $this->getIfExists("_declarations.$alias");
        $dependencies = [];

        // Now setup those dependencies into an array
        if (!$declared instanceof NoItemFoundMessage) {
            $dependencies = array_map(function(&$value) use ($alias) {
                if (is_string($value) && $this->exists("$alias")) {
                    return $this->get($value);
                }
                return $value;
            }, $declared);
        }

        /* Produce the object itself */
        if ($factory instanceof IocContainerInterface) {
            $object = $factory->get($alias);

        } elseif (is_string($factory)) {
            $class = new \ReflectionClass($factory);
            $object = $class->newInstanceArgs($dependencies);

        } elseif (is_callable($factory)) {
            array_unshift($dependencies, $this);
            $object = call_user_func_array($factory, $dependencies);

        } elseif (is_object($factory)) {
            $object = $factory;

            if (method_exists($object, "needs")) {
                call_user_func_array([$object, 'needs'], $dependencies);
            }

        } else {
            throw new \Exception("`get()` can only return from strings, callables, or objects");
        }

        /* Run the object through the pipeline, if desired */
        $pipeline = $this->getIfExists("_pipelines.$alias");

        if (!$pipeline instanceof NoItemFoundMessage) {
            /** @var \Closure $pipeline */
            $object = $pipeline($object, $this);
        }

        /* Return the final object */
        return $object;
    }
1042136
public function from($table, $alias = null) {
        $this->from [] = self::parseAs($table, $alias);

        return $this;
    }
1271897
public function getFunctionByAlias($alias)
    {
        return $this->hasFunctionAlias($alias) ? $this->getExpression($this->getHash($alias)) : null;
    }
1251608
public function get(string $alias = null)
    {
        if (is_null($alias)) {
            return $this->aliases;
        }

        return $this->has($alias) ? $this->aliases[$alias] : false;
    }
1037340
public function addFallback($name, $fallbackName)
    {
        if (!isset($this->fallbacks[$name])) {
            $this->fallbacks[$name] = array();
        }
        $this->fallbacks[$name][] = $fallbackName;
        return $this;
    }
696348
public function getLocaleCondition($alias = 'translation')
    {
        $expr = new Query\Expr();

        // TODO This may change between master/sub requests
        $current = $this->localeProvider->getCurrentLocale();
        $fallback = $this->localeProvider->getFallbackLocale();

        if ($current != $fallback) {
            return $expr->orX(
                $expr->eq($alias . '.locale', $expr->literal($this->localeProvider->getCurrentLocale())),
                $expr->eq($alias . '.locale', $expr->literal($this->localeProvider->getFallbackLocale()))
            );
        }

        return $expr->eq($alias . '.locale', $expr->literal($this->localeProvider->getCurrentLocale()));
    }
1236570
public function getAssetClassname($alias)
    {
        if (empty($this->_assets[$alias])) {
            throw new Exception("Asset '{$alias}' not found in configuration of module " . static::className());
        }
        return $this->_assets[$alias];
    }
817850
public function load($alias)
    {
        if (array_key_exists($alias, $this->aliases)) {
            return class_alias($this->aliases[$alias], $alias);
        }

        return false;
    }
18727
public function setFallbacks($fallback)
    {
        $this->localeFallbacks = (array)$fallback;
        if ($this->coreFormatter instanceof Multilingual) {
            $this->coreFormatter->setFallbacks($this->localeFallbacks);
        }
        if ($this->textProvider instanceof Multilingual) {
            $this->textProvider->setFallbacks($this->localeFallbacks);
        }
        return $this;
    }
266024
public static function createMenu($alias)
    {
        if (isset(self::$_menus[$alias])) {
            throw new Exception(__d('wasabi_core', 'A Menu with alias "{0}" already exists.', $alias));
        }
        self::$_menus[$alias] = new Menu($alias);

        return self::$_menus[$alias];
    }
1171346
public function getNew($alias)
    {
        if (!isset($this->registered[$alias]))
            return false;
        
        // Execute the Closure to get the first instance
        $object = $this->registered[$alias]($this);
        if (!is_object($object))
            throw new Exception('The alias "' . $alias . '" does not return an object.');
        
        return $object;
    }
1351111
public function getInstance($alias = null)
    {
        if (!$alias && !$this->mainAlias) {
            $namespace = explode('\\', $this->_entityName);
            $alias = strtolower(end($namespace));
            $this->mainAlias = $alias;
        } elseif ($alias) {
            $this->mainAlias = $alias;
        }

        return $this->qb ? $this->qb : $this->qb = $this->createQueryBuilder($this->mainAlias);
    }
153724
protected function getFirstAlias($alias = null)
    {
        if (false === empty($alias)) {
            return $alias;
        }

        if (null === $this->_root_alias) {
            $aliases = $this->getRootAliases();
            if (0 === count($aliases)) {
                throw new \BackBee\Exception\BBException('Cannot access to root alias');
            }

            $this->_root_alias = $aliases[0];
        }

        return $this->_root_alias;
    }
1221723
public function getCardByAlias($alias)
    {
        if (!array_key_exists($alias, $this->aliases)) {
            throw new Exception\NoSuchAliasException(sprintf('Alias "%s" has not been assigned to any cards.', $alias));
        }

        return $this->getCard($this->aliases[$alias]);
    }
297350
private function _get_template( $fallback = '' ) {
		$templates = $this->_templates();

		foreach ( $templates as $template ) {
			if ( file_exists( $template ) ) {
				return $template;
			}
		}

		return $fallback;
	}
1323381
public function call($callback, $params = [], $fallback = null)
    {
        return $this->circuitState->doCall($callback, $params, $fallback);
    }
632623
public function get($alias, $default = false, $config = array())
	{
		$result = $this->cache->get($alias);
		if(false === $result)
		{
			return $this->parseDefault($default);
		}
		else
		{
			return $result;
		}
	}