/**
  * get (sub) folder and create folders in db backend cache
  *
  * @param  mixed   $_accountId
  * @param  string  $_folderName global name
  * @param  boolean $_recursive 
  * @return Tinebase_Record_RecordSet of Expressomail_Model_Folder
  */
 public function updateFolderCache($_accountId, $_folderName = '', $_recursive = FALSE)
 {
     $account = $_accountId instanceof Expressomail_Model_Account ? $_accountId : Expressomail_Controller_Account::getInstance()->get($_accountId);
     $this->_delimiter = $account->delimiter;
     try {
         $folders = $this->_backend->getFolders($account, $_folderName);
         $result = $this->_getOrCreateFolders($folders, $account, $_folderName);
         //            $hasChildren = (empty($folders) || count($folders) > 0 && count($result) == 0) ? 0 : 1;
         //            $this->_updateHasChildren($_accountId, $_folderName, $hasChildren);
         //
         //            if ($_recursive) {
         //                $this->_updateRecursive($account, $result);
         //            }
     } catch (Zend_Mail_Protocol_Exception $zmpe) {
         Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . ' IMAP Protocol Exception: ' . $zmpe->getMessage());
         $result = new Tinebase_Record_RecordSet('Expressomail_Model_Folder');
     }
     return $result;
 }