Horde_Registry::hasInterface PHP Method

hasInterface() public method

Determine if an interface is implemented by an active application.
public hasInterface ( string $interface ) : mixed
$interface string The interface to check for.
return mixed The application implementing $interface if we have it, false if the interface is not implemented.
    public function hasInterface($interface)
    {
        return !empty($this->_interfaces[$interface]) ? $this->_interfaces[$interface] : false;
    }

Usage Example

Example #1
0
 /**
  * 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) {
         }
     }
 }
All Usage Examples Of Horde_Registry::hasInterface