當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Horde_Registry::hasInterface方法代碼示例

本文整理匯總了PHP中Horde_Registry::hasInterface方法的典型用法代碼示例。如果您正苦於以下問題:PHP Horde_Registry::hasInterface方法的具體用法?PHP Horde_Registry::hasInterface怎麽用?PHP Horde_Registry::hasInterface使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Horde_Registry的用法示例。


在下文中一共展示了Horde_Registry::hasInterface方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructor.
  *
  * @param Horde_Registry $registry         A registry object.
  * @param Horde_Dav_Storage_Base $storage  A storage object.
  */
 public function __construct(Horde_Registry $registry, Horde_Dav_Storage_Base $storage)
 {
     $this->_registry = $registry;
     $this->_storage = $storage;
     foreach (array('calendar', 'tasks') as $interface) {
         try {
             $application = $this->_registry->hasInterface($interface);
             if ($application) {
                 $this->_interfaces[$interface] = $application;
             }
         } catch (Horde_Exception $e) {
         }
     }
 }
開發者ID:jubinpatel,項目名稱:horde,代碼行數:20,代碼來源:Backend.php

示例2: deleteFolder

 /**
  * Delete a folder.
  *
  * @param string $class  The EAS collection class.
  * @param string $id     The folder id
  *
  * @since 2.12.0
  */
 public function deleteFolder($class, $id)
 {
     switch ($class) {
         case Horde_ActiveSync::CLASS_TASKS:
             if (!$this->_registry->horde->getPreference($this->_registry->hasInterface('tasks'), 'activesync_no_multiplex')) {
                 throw new Horde_ActiveSync_Exception('Deleting addressbooks not supported by the contacts API.', Horde_ActiveSync_Exception::UNSUPPORTED);
             }
             $this->_registry->tasks->deleteTasklist($id);
             break;
         case Horde_ActiveSync::CLASS_CONTACTS:
             if (!$this->_registry->hasMethod('contacts/deleteAddressbook') || !$this->_registry->horde->getPreference($this->_registry->hasInterface('contacts'), 'activesync_no_multiplex')) {
                 throw new Horde_ActiveSync_Exception('Deleting addressbooks not supported by the contacts API.', Horde_ActiveSync_Exception::UNSUPPORTED);
             }
             $this->_registry->contacts->deleteAddressbook($id);
             break;
         case Horde_ActiveSync::CLASS_CALENDAR:
             if (!$this->_registry->hasMethod('calendar/deleteCalendar') || !$this->_registry->horde->getPreference($this->_registry->hasInterface('calendar'), 'activesync_no_multiplex')) {
                 throw new Horde_ActiveSync_Exception('Deleting calendars not supported by the calendar API.', Horde_ActiveSync_Exception::UNSUPPORTED);
             }
             $this->_registry->calendar->deleteCalendar($id);
             break;
         case Horde_ActiveSync::CLASS_NOTES:
             if (!$this->_registry->hasMethod('notes/deleteNotepad') || !$this->_registry->horde->getPreference($this->_registry->hasInterface('notes'), 'activesync_no_multiplex')) {
                 throw new Horde_ActiveSync_Exception('Deleting notepads not supported by the notes API.', Horde_ActiveSync_Exception::UNSUPPORTED);
             }
             $this->_registry->notes->deleteNotepad($id);
             break;
     }
 }
開發者ID:horde,項目名稱:horde,代碼行數:37,代碼來源:Connector.php

示例3: _contacts

 /**
  * Returns the name of the application providing the 'contacts' interface.
  *
  * @return string  An application name.
  * @throws Sabre\DAV\Exception if no contacts application is installed.
  */
 protected function _contacts()
 {
     $contacts = $this->_registry->hasInterface('contacts');
     if (!$contacts) {
         throw new DAV\Exception('No contacts application installed');
     }
     return $contacts;
 }
開發者ID:kossamums,項目名稱:horde,代碼行數:14,代碼來源:Backend.php


注:本文中的Horde_Registry::hasInterface方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。