Method is used to open specific instance of container.
@param string $key Identifier for inner storage to find the proper instance to open or create.
@return object Instance of Container class picked by $key.
503602
public static function open($key, $private = false, $secure = false){

        if( !isset(self::$privates[$key]) && ($private === true) ){
            self::$privates[$key] = new Container;
            self::$privates[$key]->name = $key;
            self::$privates[$key]->secure = false;
            if($secure){
                self::$privates[$key]->secure = true;
            }
            return self::$privates[$key];
        }

        if( !isset(self::$instance[$key]) && ($private === false) ){
            self::$instance[$key] = new Container;
            self::$instance[$key]->name = $key;
            self::$instance[$key]->secure = false;
            if($secure){
                self::$instance[$key]->secure = true;
            }

            return self::$instance[$key];
        }else if( $private === false ){
            return self::$instance[$key];
        }

        throw new Exception("Container instance cannot be opened!");
    }
575336
public function touchKey($key)
    {
        if ($this->supportsTouching()) {
            return $this->driver->touchKey($key);
        }
        throw new StorageException(StorageException::DRIVER_DOES_NOT_SUPPORT_TOUCH, [get_class($this->driver)]);
    }
1216428
protected function getFileKey($key)
    {
        $key = (string) $key;
        if (!array_key_exists($key, $this->fileKeys))
        {
            $this->fileKeys[$key] = new FileKey($key);
        }
        
        return $this->fileKeys[$key];
    }
233135
public function remove($key): self
    {
        // recursive call
        if (\is_array($key)) {
            foreach ($key as $k) {
                $this->internalRemove($k);
            }

            return static::create(
                $this->getArray(),
                $this->iteratorClass,
                false
            );
        }

        $this->internalRemove($key);

        return static::create(
            $this->getArray(),
            $this->iteratorClass,
            false
        );
    }
983016
public static function getInstance($key)
	{
		if (!isset(self::$instance[$key])) {
			self::$instance[$key] = new Debugger();
		}
		return self::$instance[$key];
	}
1289142
public function remove($key)
    {
        if (is_object($key)) {
            $key = spl_object_hash($key);
        }

        unset($this->data[$key]);

        return $this;
    }
1299151
public function setContainer($key, Placeholder\HtmlClassContainer $container)
    {
        $this->registry->setContainer($key, $container);

        return $this;
    }
515039
public static function getInstance($key)
    {
        if (isset(self::$instances[$key])) {
            return self::$instances;
        }

        $config = TwitterOAuth::getConfig()->get($key, false);

        if (!$config) {
            throw new TwitterOAuthException('Unable to read "TwitterOAuth.' . $key . '" configuration.');
        }

        if (strpos($config->RedirectUri, 'http://') !== false || strpos($config->RedirectUri, 'https://'
            ) !== false
        ) {
            $redirectUri = $config->RedirectUri;
        } else {
            $redirectUri = self::httpRequest()->getCurrentUrl(true)->setPath($config->RedirectUri)->setQuery('')->val();
        }

        $instance = \Webiny\Component\TwitterOAuth\Bridge\TwitterOAuth::getInstance($config->ClientId,
                                                                                    $config->ClientSecret, $redirectUri
        );

        return new TwitterOAuth($instance);
    }
700560
public static function getInstance($key = null)
    {
        $config = Container::get('config')->get('db');
        if (!is_array($config) || count($config) == 0) {
            return null;
        } elseif ($key == null) {
            $dbKeys = array_keys($config);
            if (isset($dbKeys[0])) {
                $key = $dbKeys[0];
            } else {
                return null;
            }
        }

        Container::get('config')->set('selected_db_key', $key);

        if (!isset(self::$instance[$key])) {
            try {
                self::$instance[$key] = new self($config[$key]);
            } catch (PDOException $e) {
                throw new DatabaseException($e);
            } catch (Exception $e) {
                throw new DatabaseException($e);
            }
        }

        return self::$instance[$key];
    }
1293384
public function get($key)
    {
        $key = $this->createKey($key);
        return $this->instance->get($key);
    }
382169
public function create($key)
    {
        $classMap = $this->classMap();
        if (array_key_exists($key, $classMap)) {
            $class = $classMap[$key];

            return new $class;
        }

        return null;
    }
75183
public function newFromKey($key)
    {
        $scope = $this->get($key);
        if ($this->checkRefs && is_array($scope)) {
            $this->replaceRefs($key, $scope);
        }
        $result = new static($scope);

        return $result;
    }
1039428
public static function createNormalizer($key = 'default')
    {
        return isset(self::$instancePool[$key]) ?
            self::$instancePool[$key] :
            self::$instancePool[$key] = new static(
            PropertyAccess::createPropertyAccessor()
        );
    }
53876
public function addChild($key)
	{
		$object = new StdClassTargetBuilder();
		$this->data->$key = new \stdClass();
		$object->data = $this->data->$key;
		return $object;
	}
516142
public static function find($key)
    {
        $instance = new static;

        $model = $instance->newQuery()->id($key)->take(1)->first();

        if ($model) {
            $model->exists = true;
        }

        return $model;
    }
896222
public function getObjectByKey($key)
       {
            if (isset($this->map[$key])) {
                parent::rewind();
                while(parent::valid()) {
                    if (parent::key() === $key) {
                        return parent::current();
                    }
                    parent::next();
                }
            }
       }
802065
public function get($key)
    {
        $key = strtolower($key);

        if (!isset($this->services[$key])) {
            throw new \InvalidArgumentException('Service not found: ' . $key);
        }

        // Have we been here before?
        if (isset($this->loadedService[$key])) {
            return $this->loadedService[$key];
        }

        if (!$this->services[$key] instanceof Service) {
            $this->loadedService[$key] = $this->services[$key];

            return $this->loadedService[$key];
        }

        // It's a Service instance, lets do some extra stuff.
        if (!$this->services[$key]->hasClassName()) {
            throw new \Exception('Unable to find class name from definition: ' . $key);
        }

        $className = $this->services[$key]->getClassName();
        $instance  = new $className();

        if ($this->services[$key]->hasFactoryMethod()) {
            call_user_func($instance, $this->services[$key]->getFactoryMethod());
        }

        $this->loadedService[$key] = $instance;

        return $this->loadedService[$key];
    }