Horde_Kolab_Storage_Driver_Base::getNamespace PHP Method

getNamespace() public method

Retrieve the namespace information for this connection.
public getNamespace ( ) : Horde_Kolab_Storage_Folder_Namespace
return Horde_Kolab_Storage_Folder_Namespace The initialized namespace handler.
    public function getNamespace()
    {
        if ($this->_namespace === null) {
            if (isset($this->_params['namespaces'])) {
                $this->_namespace = $this->_factory->createNamespace('config', $this->getAuth(), $this->_params['namespaces']);
            } else {
                $this->_namespace = $this->_factory->createNamespace('fixed', $this->getAuth());
            }
        }
        return $this->_namespace;
    }

Usage Example

Beispiel #1
0
 /**
  * Retrieve the namespace information for this connection.
  *
  * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler.
  */
 public function getNamespace()
 {
     if ($this->getBackend()->hasCapability('NAMESPACE') === true) {
         $namespaces = array();
         foreach ($this->getBackend()->getNamespace() as $type => $elements) {
             foreach ($elements as $namespace) {
                 switch ($type) {
                     case 'others':
                         $namespace['type'] = 'other';
                         break;
                     default:
                         $namespace['type'] = $type;
                         break;
                 }
                 $namespace['delimiter'] = $namespace['delimter'];
                 $namespaces[] = $namespace;
             }
         }
         return new Horde_Kolab_Storage_Folder_Namespace_Imap($this->getAuth(), $namespaces, $this->getParam('namespaces', array()));
     }
     return parent::getNamespace();
 }
All Usage Examples Of Horde_Kolab_Storage_Driver_Base::getNamespace