当前位置: 首页>>代码示例>>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;未经允许,请勿转载。