当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Mail_Storage_Folder::isSelectable方法代码示例

本文整理汇总了PHP中Zend_Mail_Storage_Folder::isSelectable方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Mail_Storage_Folder::isSelectable方法的具体用法?PHP Zend_Mail_Storage_Folder::isSelectable怎么用?PHP Zend_Mail_Storage_Folder::isSelectable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Mail_Storage_Folder的用法示例。


在下文中一共展示了Zend_Mail_Storage_Folder::isSelectable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: transformToFolderDto

 /**
  * Transforms an imap Zend_Mail_Storage_Folder to an instance
  * of Conjoon_Modules_Groupware_Email_Folder_Dto.
  *
  * @param Zend_Mail_Storage_Folder $folder
  * @param boolean $lookupStandardNames Whether standard names like "INBOX"
  * and trash should be looked up and addiotnal properties adjusted for them.
  * @param array $config A preset set of config properties which are used
  * for the properties of the created FolderDto. By now, only the id, the
  * idForPath and the pendingCount property  are considered.
  *
  * @return Conjoon_Modules_Groupware_Email_Folder_Dto
  */
 public static function transformToFolderDto(Zend_Mail_Storage_Folder $folder, $lookupStandardNames = false, array $config = array())
 {
     /**
      * @see Conjoon_Modules_Groupware_Email_Folder_Dto
      */
     require_once 'Conjoon/Modules/Groupware/Email/Folder/Dto.php';
     $tmpFolder = new Conjoon_Modules_Groupware_Email_Folder_Dto();
     // go through predefined variables
     if (isset($config['id'])) {
         $tmpFolder->id = $config['id'];
     } else {
         $tmpFolder->id = $folder->getGlobalName();
     }
     if (isset($config['idForPath'])) {
         $tmpFolder->idForPath = $config['idForPath'];
     } else {
         $tmpFolder->idForPath = $folder->getGlobalName();
     }
     if (isset($config['pendingCount'])) {
         $tmpFolder->pendingCount = $config['pendingCount'];
     }
     $childCount = 0;
     if (isset($config['childCount'])) {
         $childCount = $config['childCount'];
     }
     $tmpFolder->type = $config['type'];
     $tmpFolder->name = $folder->getLocalName();
     $tmpFolder->isChildAllowed = 1;
     $tmpFolder->isLocked = 0;
     //hasChildren doesnt seem to work
     $tmpFolder->childCount = $childCount;
     $tmpFolder->isSelectable = $folder->isSelectable() ? 1 : 0;
     return $tmpFolder;
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:47,代码来源:ImapHelper.php

示例2: _transformImapFolder

 /**
  * Gathers all needed information to tranform an imap folder to a
  * Conjoon_Modules_Groupware_Email_Folder_Dto obejct.
  *
  * @param Zend_Mail_Storage_Folder $folder
  * @param Conjoon_Modules_Groupware_Email_Account_Dto $account
  * @param Zend_Mail_Protocol_Imap $protocol
  * @param boolean $isRootLevel Whether the folder is on the first level of
  * the mailbox hierarchy
  *
  * @return Conjoon_Modules_Groupware_Email_Folder_Dto
  */
 private function _transformImapFolder(Zend_Mail_Storage_Folder $folder, Conjoon_Modules_Groupware_Email_Account_Dto $account, Zend_Mail_Protocol_Imap $protocol, $isRootLevel = false, $type = 'folder')
 {
     $delim = Conjoon_Modules_Groupware_Email_ImapHelper::getFolderDelimiterForImapAccount($account);
     $globalName = $folder->getGlobalName();
     $path = explode($delim, $globalName);
     $path = $path[count($path) - 1];
     $pendingCount = 0;
     if (!$this->itemListRequestFacade) {
         $this->itemListRequestFacade = Conjoon_Modules_Groupware_Email_Item_ItemListRequestFacade::getInstance();
     }
     if ($folder->isSelectable()) {
         try {
             $pendingCount = $this->itemListRequestFacade->getPendingCountForGlobalName($account, $globalName);
         } catch (Exception $e) {
             // ignore
         }
     }
     $childCount = 0;
     if (!$folder->isLeaf()) {
         $protocol = Conjoon_Modules_Groupware_Email_ImapHelper::reuseImapProtocolForAccount($account);
         /**
          * @see Zend_Mail_Storage_Imap
          */
         require_once 'Zend/Mail/Storage/Imap.php';
         $imap = new Zend_Mail_Storage_Imap($protocol);
         /**
          * @ticket CN-595
          */
         if ($globalName === "INBOX") {
             $iFolders = $imap->getFolders(null)->getChildren();
         } else {
             $iFolders = $imap->getFolders($globalName)->getChildren();
         }
         foreach ($iFolders as $tmpFolder) {
             $childCount++;
         }
     }
     return Conjoon_Modules_Groupware_Email_ImapHelper::transformToFolderDto($folder, $isRootLevel, array('id' => $account->id . '_' . $globalName, 'idForPath' => $path, 'pendingCount' => $pendingCount, 'type' => $type, 'childCount' => $childCount));
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:51,代码来源:Facade.php


注:本文中的Zend_Mail_Storage_Folder::isSelectable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。