Invalidate a namespace.

@param string $namespaceId The id of the namespace to invalidate.

@return boolean TRUE if the namespace entry was successfully regenerated, FALSE otherwise.
420867
public function invalidate($namespaceId)
    {
        $namespace = $this->fetch($namespaceId);

        if (false === $namespace) {
            return false;
        }

        $newNamespace = rand(0, 10000);
        // @codeCoverageIgnoreStart
        while ($namespace === $newNamespace) {
            $newNamespace = rand(0, 10000);
        }

        // @codeCoverageIgnoreEnd
        return $this->save($namespaceId, $namespaceId . '_' . $newNamespace .'_', 0);
    }
832073
static public function formatNamespace($namespace)
	{
	    if (is_array($namespace)) {
	        foreach ($namespace as $k => $v) {
	            $namespace[$k] =  static::formatNamespace($v);
	        }
	    } else {
	        $namespace = trim(str_replace('/', '\\', $namespace), '\\') . '\\';
	    }
	    
	    return $namespace;
	}
780209
public function recycle($userId)
    {
        $token = $this->getTokenByUserId($userId);
        if ($token) {
            $this->redisClient->hdel(static::TOKEN_HASH_NAMESPACE, $token);
        }
        $this->redisClient->hdel(static::USER_ID_HASH_NAMESPACE, $userId);

        return true;
    }
558375
public function validateNamespace($namespace)
    {
        if (empty($namespace)) {
            $this->addError('namespace', 'Namespace cannot be empty');
            return false;
        }

        if (substr($namespace, 0, 1) !== '/') {
            $this->addError('namespace', 'The namespace have to start with the character "/".');
            return false;
        }

        if (strlen($namespace) > 255) {
            $this->addError('namespace', 'Namespace length cannot exceed 255 chars');
            return false;
        }

        return true;
    }
900851
protected function validateNamespace($namespace)
    {
        switch ($namespace) {
            case 'ns:DNS':
                return Uuid::NAMESPACE_DNS;
                break;
            case 'ns:URL':
                return Uuid::NAMESPACE_URL;
                break;
            case 'ns:OID':
                return Uuid::NAMESPACE_OID;
                break;
            case 'ns:X500':
                return Uuid::NAMESPACE_X500;
                break;
        }

        if (Uuid::isValid($namespace)) {
            return $namespace;
        }

        throw new Exception(
            'Invalid namespace. '
            . 'May be either a UUID in string representation or an identifier '
            . 'for internally pre-defined namespace UUIDs (currently known '
            . 'are "ns:DNS", "ns:URL", "ns:OID", and "ns:X500").'
        );
    }
746837
def is_namespace_ready( self, namespace_id ):
        
        namespace = self.get_namespace( namespace_id )
        if namespace is not None:
            return True
        else:
            return False
98268
final public function remove($varname = '', $namespace = 'default')
    {
        //if the registry is empty and the namespace is not default
        //delete the registry;
        //stores a value to a varname in a namespace of this session
        $session = $this;


        //echo $namespace;
        //@TODO, check if the regitry is not locked before adding
        if (!$session->isLocked($namespace)) {

            $registry = $session->getNamespace($namespace);
            $registry->delete($varname);
        }
        //If auth is locked

        return $session;
    }
234724
public function remove(string $nameId): bool
    {
        if (array_key_exists($nameId, $this->elements) === false) {
            return false;
        }

        unset($this->elements[$nameId]);
        return false;
    }
1263210
public static function qualifiedClassName($className, $namespace)
    {
        if (empty($className)) {
            throw new \InvalidArgumentException('Class name cannot be empty.');
        }

        if (empty($namespace)) {
            throw new \InvalidArgumentException('Current namespace cannot be empty.');
        }

        $className = trim($className, '\\');
        $len = strlen($namespace);

        if (strlen($className) > $len && ($namespace . '\\') === substr($className, 0, $len + 1)) {
            return substr($className, $len + 1);
        }

        return $className;
    }
1076743
public function removeNamespace( $prefix, $namespace )
	{
		if ( ! $this->hasNamespace( $prefix ) ) return false;
		unset( $this->namespaces[ $prefix ] );
		return true;
	}
1099012
static function deleteConfigByName($namespace, $name) 
    {
        $result = CommonConfigModel::where('namespace', $namespace)
                                    ->where('name', $name)
                                    ->delete();
        self::setCache($namespace);
        return $result;
    }
644083
public function unsetOverrider($namespace = null)
    {
        if (is_null($namespace)) {
            $this->overrides = [];
        } else {
            unset($this->overrides[$namespace]);
        }

        $this->makeLog('Override unset for: ' . $namespace);

        return $this;
    }
1021821
protected function endSubscription($subscriptionId = null)
    {
        if (!$subscriptionId) {
            $subscriptionId = $this->subscriptions->getLast()->getSubscriptionId();
        }
        if (!isset($this->subscriptions[$subscriptionId])) {
            throw new InvalidArgumentException(sprintf('%s is no active subscription!', $subscriptionId));
        }
        $subscription = $this->subscriptions[$subscriptionId];
        $this->getClient()->sendFrame(
            $this->getProtocol()->getUnsubscribeFrame(
                $subscription->getDestination(),
                $subscription->getSubscriptionId()
            )
        );
        IdGenerator::releaseId($subscription->getSubscriptionId());

        unset($this->subscriptions[$subscription->getSubscriptionId()]);

        if ($this->subscriptions->count() == 0) {
            return true;
        }
        return false;
    }
190533
public function getNamespace($modelid)
    {
        $returnValue = null;
    
        if(count($this->namespaces) == 0){
        	$this->getAllNamespaces();	//load the namespaces attribute 
       	}
        
        //get modelId from modelUri
        if(is_string($modelid)){
        	$modelid = array_search($modelid, $this->namespaces);
        }
        
    	//get namespace from modelId
    	if(is_int($modelid)){
        	if(isset($this->namespaces[$modelid])){
        		$returnValue = new common_ext_Namespace($modelid, $this->namespaces[$modelid]);
        	}
        }

        return $returnValue;
    }
121470
public static function delete(string $name, string $namespace = '*'): void
    {
        self::initialize();
        if (isset($_SESSION[$namespace][$name])) {
            unset($_SESSION[$namespace][$name]);
            if (count($_SESSION[$namespace]) === 0) {
                unset($_SESSION[$namespace]);
            }
        }
    }
1000441
public function registerNamespace($namespace, $paths)
    {
        if (false === isset($this->_namespaces[$namespace])) {
            $this->_namespaces[$namespace] = array();
        }

        $this->_namespaces[$namespace] = array_merge($this->_namespaces[$namespace], (array) $paths);

        return $this;
    }
490481
public function id($id)
    {
        $parts = array_merge(array($this->namespace), func_get_args());
        return trim(implode(self::$namespaceSeparator, $parts), self::$namespaceSeparator);
    }