Jackalope\Transport\DoctrineDBAL\Client::registerNamespace PHP Method

registerNamespace() public method

{@inheritDoc}
public registerNamespace ( $prefix, $uri )
    public function registerNamespace($prefix, $uri)
    {
        if (isset($this->namespaces[$prefix])) {
            if ($this->namespaces[$prefix] === $uri) {
                return;
            }
            if (isset($this->coreNamespaces[$prefix])) {
                throw new NamespaceException("Cannot overwrite JCR core namespace prefix '{$prefix}' to a new uri '{$uri}'.");
            }
        }
        $this->ensureNamespacesBackup();
        $this->getConnection()->delete('phpcr_namespaces', array('prefix' => $prefix));
        $this->getConnection()->delete('phpcr_namespaces', array('uri' => $uri));
        $this->getConnection()->insert('phpcr_namespaces', array('prefix' => $prefix, 'uri' => $uri));
        if (!empty($this->namespaces)) {
            $this->namespaces[$prefix] = $uri;
        }
    }

Usage Example

Example #1
0
 /**
  * {@inheritDoc}
  */
 public function registerNamespace($prefix, $uri)
 {
     return $this->transport->registerNamespace($prefix, $uri);
 }
All Usage Examples Of Jackalope\Transport\DoctrineDBAL\Client::registerNamespace