Create a (potentially new) LTI_Tool_Consumer

@param string $key (Optional)
@return LTI_Tool_Consumer
425985
private function interactiveConsumersControlPanel_loadConsumer($key = null)
    {
        /*
         * load an existing consumer (if we have a consumer_key) or create a blank
         * that we will fill in
         */
        $consumer = new LTI_Tool_Consumer(
            (empty($key) ? LTI_Data_Connector::getRandomString(32) : $key),
            $this->getToolProvider()->data_connector,
            true // wicked confusing _not_ to autoenable
        );

        /* pre-fill secret if not editing an existing consumer */
        if (empty($key)) {
            $consumer->secret = LTI_Data_Connector::getRandomString(32);
        }

        return $consumer;
    }
1321710
public function setKey($key)
    {
        $this->key = $key;

        // Initialize if we're the first instance.
        if (! session()->has('bzarzuela.filters')) {
            session(['bzarzuela.filters' => [$key => []]]);
        }

        return $this;
    }
686975
public function loadDriver(string $key): DriverInterface
    {
        if (!$this->hasDriver($key)) {
            throw new DriverNotFoundException('Driver you are looking for doesn\'t exist. Make sure that ' . $key . ' driver is properly configured.');
        }

        return $this->drivers[$key]::install($this);
    }
1116450
public function getSection(string $key) : ConfigurationBagInterface
    {
        return new ConfigurationBag(isset($this->parameters[$key]) ? $this->parameters[$key] : []);
    }
420338
public function lpop($key)
    {
        $this->init();
        $result = $this->driver->lpop($key);
        return $this->convertFalseToNull($result);
    }
187059
public static function create($key)
    {
        // Ignore arrays and objects
        if (is_object($key) or is_array($key)) {
            $key = '';
        }

        $key_string = strval($key);

        $key = new self;
        $key->raw = $key_string;

        $keys = explode('.', $key_string);

        foreach ($keys as $value) {
            $key->push($value);
        }

        $key->rewind();

        return $key;
    }
575016
public function lookupConsumer($consumer_key)
    {
        return new Consumer(
            $this->tool_provider->consumer->getKey(),
            $this->tool_provider->consumer->secret
        );
    }
950207
public function release_lock($key) {
        $key = $this->parse_key($key);
        if ($this->nativelocking) {
            return $this->get_store()->release_lock($key, $this->get_identifier());
        } else {
            $this->ensure_cachelock_available();
            return $this->cachelockinstance->unlock($key, $this->get_identifier());
        }
    }
347567
public function setKey($key)
    {
        $arr = $this->parseKey($key);
        $this->key = $arr['key'];
        $this->identifier = $arr['identifier'];
        $this->prefix = $arr['prefix'];

        return $this;
    }
897158
public function loadByKey($key)
    {
        $configuration = new Configuration();
        require $key;
        $vars = get_defined_vars();
        unset($vars['configuration']);
        unset($vars['key']);
        foreach ($vars as $name => $value) {
            $configuration->{$name} = $value;
        }

        return $configuration;
    }
218849
public function need($key)
    {
        if(!isset($this->resolved[$key])) {
            return $this->make($key);
        }

        return $this->resolved[$key];
    }
558800
public function consume($key)
    {
        $value = $this->get($key);
        $this->delete($key);

        return $value;
    }
906055
protected function getMethod($key)
    {
        switch ($key) {
            case CopyMethod::NAME:
                return new CopyMethod();
            case SymlinkMethod::NAME:
                return new SymlinkMethod();
            case JunctionMethod::NAME:
                return new JunctionMethod();
            case VendorPlugin::METHOD_NONE:
                // 'none' is forced to an empty chain
                return new ChainedMethod([]);
            case VendorPlugin::METHOD_AUTO:
                // Default to safe-failover method
                if (Platform::isWindows()) {
                    // Use junctions on windows environment
                    return new ChainedMethod(new JunctionMethod(), new CopyMethod());
                } else {
                    // Use symlink on non-windows environments
                    return new ChainedMethod(new SymlinkMethod(), new CopyMethod());
                }
            default:
                throw new InvalidArgumentException("Invalid method: {$key}");
        }
    }
389971
public function getCache($key) {
        if (!$this->__cacheEnabled) {
            return null;
        }

        $key = $this->createCacheKey($key);

        if ($this->hasCache($key)) {
            return $this->_cache[$key];
        }

        return null;
    }
694985
public function get($key)
	{
		$item = new Item($key);

		if ($this->exists($key))
		{
			$item->setValue(xcache_get($key));
		}

		return $item;
	}
382169
public function create($key)
    {
        $classMap = $this->classMap();
        if (array_key_exists($key, $classMap)) {
            $class = $classMap[$key];

            return new $class;
        }

        return null;
    }
355157
public function addConfiguration($key)
    {
        $adminConfiguration = new AdminConfiguration();

        $adminConfiguration->key($key);
        $this->groupList->put($key, $adminConfiguration);

        return $adminConfiguration;
    }