本文整理汇总了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) {
}
}
}
示例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;
}
}
示例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;
}