getFolders example


    public function selectFolder($globalName)
    {
        $this->_currentFolder = (string)$globalName;

        // getting folder from folder tree for validation         $folder = $this->getFolders($this->_currentFolder);

        try {
            $this->_openMboxFile($this->_rootdir . $folder->getGlobalName());
        } catch(Zend_Mail_Storage_Exception $e) {
            // check what went wrong             if (!$folder->isSelectable()) {
                /** * @see Zend_Mail_Storage_Exception */
                throw new Zend_Mail_Storage_Exception("{$this->_currentFolder} is not selectable", 0, $e);
            }
            

    public function selectFolder($globalName)
    {
        $this->_currentFolder = (string)$globalName;

        // getting folder from folder tree for validation         $folder = $this->getFolders($this->_currentFolder);

        try {
            $this->_openMaildir($this->_rootdir . '.' . $folder->getGlobalName());
        } catch(Zend_Mail_Storage_Exception $e) {
            // check what went wrong             if (!$folder->isSelectable()) {
                /** * @see Zend_Mail_Storage_Exception */
                throw new Zend_Mail_Storage_Exception("{$this->_currentFolder} is not selectable", 0, $e);
            }
            
 else if ($parentFolder != null) {
            $folder = rtrim($parentFolder$this->_delim) . $this->_delim . $name;
        } else {
            $folder = $name;
        }

        $folder = trim($folder$this->_delim);

        // first we check if we try to create a folder that does exist         $exists = null;
        try {
            $exists = $this->getFolders($folder);
        } catch (Zend_Mail_Exception $e) {
            // ok         }
        if ($exists) {
            /** * @see Zend_Mail_Storage_Exception */
            throw new Zend_Mail_Storage_Exception('folder already exists');
        }

        if (strpos($folder$this->_delim . $this->_delim) !== false) {
            
Home | Imprint | This part of the site doesn't use cookies.