Unregister an instances

Look for GUARDIAN OR CLASS_LOOKUP key, otherwise fallback to parent

@param string $key
@param string $name
@return bool
@throws \common_Exception
320587
public function unregister($key, $name)
    {
        if (empty($key) || empty($name)) {
            throw new \common_Exception(__('Unregister method expects $key and $name parameters.'));
        }

        if (is_object($name)) {
            $name = get_class($name);
        }

        switch ($key) {
            case self::GUARDIAN_KEY:
                $this->unregisterInstance(self::GUARDIAN_KEY, $name);
                return true;
                break;
            case self::CLASS_LOOKUP_KEY:
                $this->unregisterInstance(self::CLASS_LOOKUP_KEY, $name);
                return true;
                break;
        }
        return parent::unregister($key, $name);
    }
619530
public function delete($key)
    {
        if ($this->has($key)) {
            unset($this->registry[$key]);
            return true;
        }
        return false;
    }
741036
public function delete($key)
	{
		if (isset($this->jar[$key]) and ! $this->jar[$key]->isDeleted())
		{
			return $this->jar[$key]->delete();
		}
		elseif ($this->has($key))
		{
			return $this->parent->delete($key);
		}

		return false;
	}
1213854
public function removeChild($name)
    {
        foreach ($this->children as $key => $child) {
            if ($child->appliesTo($name) === true) {
                unset($this->children[$key]);
                $this->updateModifications();
                return true;
            }
        }

        return false;
    }
531913
public function remove($key){

        if($this->secure){
            throw new Exception("You can't remove items from secure instance of container ($this->name)");
        }

        if( !$this->exists($key) ){
            throw new Exception("Item does not exist in storage ($key)");
        }
        unset($this->storage[$key]);    

    }
1107062
public function forget($key)
    {
        if (is_array($key)) {
            return $this->forgetMany($key);
        }

        return parent::forget($key);
    }
19209
public function deleteByKey($name) : void
    {
        if(!$this->keyExists($name)) {
            return;
        }

        parent::deleteByKey($name);
        unset($_SESSION[$name]);
    }
547286
public function settingExists($name, $key=null)
	{
		if( is_string($name) )
		{
			$ret = array_key_exists($name,$this->_settings);

			if( $ret && $key !== null )
			{
				$ret = array_key_exists( $key, $this->_settings[ $name ] );
			}
		}
		else
		{
			$ret = false;
		}
		return $ret;
	}
61948
public static function unregister_observer($name)
	{
		$class = get_called_class();
		foreach (static::observers() as $key => $value)
		{
			if ((is_array($value) and $key == $name) or $value == $name)
			{
				unset(static::$_observers_cached[$class][$key]);
			}
		}
	}
749564
public static function unbindBehavior($name) {
		list($model, $class) = static::_classesForBehavior($name);
		static::_initializeBehaviors();

		if (!isset(static::$_behaviors[$model][$class])) {
			throw new RuntimeException("Behavior `{$class}` not bound to model `{$model}`.");
		}
		unset(static::$_behaviors[$model][$class]);
	}
855039
public function remove( $key )
	{
		if( !isset( $GLOBALS[$this->poolKey][$key] ) )
			return false;
		unset( $GLOBALS[$this->poolKey][$key] );
		return true;	
	}
160727
public function forget($key)
	{
		@list($group, $name) = $this->id($key);

		$this->engine->setOption('cacheDir', $this->directory . DS . $group . DS);

		$success = $this->engine->remove($name, $group);

		if ($success == true)
		{
			return $success;
		}

		return false;
	}
134054
public function unregister($name)
    {
        if (!isset($this->registry[$name])) {
            throw new Exception('Object with name "'.$name.'" is not registered');
        }

        $object = $this->registry[$name];
        unset($this->registry[$name]);

        return $object;
    }
1265990
public function delete_store_instance($name) {
        if (!array_key_exists($name, $this->configstores)) {
            throw new cache_exception('The requested store does not exist.');
        }
        if ($this->configstores[$name]['default']) {
            throw new cache_exception('The can not delete the default stores.');
        }
        foreach ($this->configmodemappings as $mapping) {
            if ($mapping['store'] === $name) {
                throw new cache_exception('You cannot delete a cache store that has mode mappings.');
            }
        }
        foreach ($this->configdefinitionmappings as $mapping) {
            if ($mapping['store'] === $name) {
                throw new cache_exception('You cannot delete a cache store that has definition mappings.');
            }
        }

        // Call instance_deleted()
        $class = 'cachestore_'.$this->configstores[$name]['plugin'];
        $store = new $class($name, $this->configstores[$name]['configuration']);
        $store->instance_deleted();

        unset($this->configstores[$name]);
        $this->config_save();
        return true;
    }
1133307
public function removeChild( $name )
	{
		if( !array_key_exists( $name, $this->children ) )
			return FALSE;
		unset( $this->children[$name] );
		return TRUE;
	}
873073
public function delete($key)
    {
        try {
            $this->get($key);
        } catch (KeyNotFoundException $e) {
            return false;
        }

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

        return true;
    }
105247
public function empty(string $name = '', string $key = ''): self
    {
        $this->addBeforeRender(function () use ($name, $key) {
            $value = array_merge(
                [$key => $name],
                $this->get('options', [])
            );

            $this->set('options', $value);
        });

        return $this;
    }