getGlobalName example


    public function createFolder($name$parentFolder = null)
    {
        // TODO: we assume / as the hierarchy delim - need to get that from the folder class!         if ($parentFolder instanceof Zend_Mail_Storage_Folder) {
            $folder = $parentFolder->getGlobalName() . '/' . $name;
        } else if ($parentFolder != null) {
            $folder = $parentFolder . '/' . $name;
        } else {
            $folder = $name;
        }

        if (!$this->_protocol->create($folder)) {
            /** * @see Zend_Mail_Storage_Exception */
            throw new Zend_Mail_Storage_Exception('cannot create folder');
        }

    public function createFolder($name$parentFolder = null)
    {
        if ($parentFolder instanceof Zend_Mail_Storage_Folder) {
            $folder = $parentFolder->getGlobalName() . $this->_delim . $name;
        } 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 {
            

        unset($this->_folders[$name]);
    }

    /** * magic method for easy output of global name * * @return string global name of folder */
    public function __toString()
    {
        return (string)$this->getGlobalName();
    }

    /** * get local name * * @return string local name */
    public function getLocalName()
    {
        return $this->_localName;
    }

    

        $currentFolder = $this->_rootFolder;
        $subname = trim($rootFolder$this->_delim);
        while ($currentFolder) {
            @list($entry$subname) = @explode($this->_delim, $subname, 2);
            $currentFolder = $currentFolder->$entry;
            if (!$subname) {
                break;
            }
        }

        if ($currentFolder->getGlobalName() != rtrim($rootFolder$this->_delim)) {
            /** * @see Zend_Mail_Storage_Exception */
            throw new Zend_Mail_Storage_Exception("folder $rootFolder not found");
        }
        return $currentFolder;
    }

    /** * select given folder * * folder must be selectable! * * @param Zend_Mail_Storage_Folder|string $globalName global name of folder or instance for subfolder * @return null * @throws Zend_Mail_Storage_Exception */
$currentFolder = $this->_rootFolder;
        $subname = trim($rootFolder, DIRECTORY_SEPARATOR);
        while ($currentFolder) {
            @list($entry$subname) = @explode(DIRECTORY_SEPARATOR, $subname, 2);
            $currentFolder = $currentFolder->$entry;
            if (!$subname) {
                break;
            }
        }

        if ($currentFolder->getGlobalName() != DIRECTORY_SEPARATOR . trim($rootFolder, DIRECTORY_SEPARATOR)) {
            /** * @see Zend_Mail_Storage_Exception */
            throw new Zend_Mail_Storage_Exception("folder $rootFolder not found");
        }
        return $currentFolder;
    }

    /** * select given folder * * folder must be selectable! * * @param Zend_Mail_Storage_Folder|string $globalName global name of folder or instance for subfolder * @return null * @throws Zend_Mail_Storage_Exception */
Home | Imprint | This part of the site doesn't use cookies.