PHP Класс Horde_PubSub_Provider, horde

Use Horde_PubSub_Provider when you want to create a per-instance plugin system for your objects.
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_topics Subscribed topics and their handles

Открытые методы

Метод Описание
clearHandles ( string $topic ) : void Clear all handlers for a given topic
getSubscribedHandles ( string $topic ) : array Retrieve all handlers for a given topic
getTopics ( ) : array Retrieve all registered topics
publish ( string $topic, mixed $args = null ) : void Publish to all handlers for a given topic
subscribe ( string $topic, string | object $context, null | string $handler = null ) : Horde_PubSub_Handle Subscribe to a topic
unsubscribe ( Horde_PubSub_Handle $handle ) : boolean Unsubscribe a handler from a topic

Описание методов

clearHandles() публичный Метод

Clear all handlers for a given topic
public clearHandles ( string $topic ) : void
$topic string
Результат void

getSubscribedHandles() публичный Метод

Retrieve all handlers for a given topic
public getSubscribedHandles ( string $topic ) : array
$topic string
Результат array Array of Horde_PubSub_Handle objects

getTopics() публичный Метод

Retrieve all registered topics
public getTopics ( ) : array
Результат array

publish() публичный Метод

Publish to all handlers for a given topic
public publish ( string $topic, mixed $args = null ) : void
$topic string
$args mixed All arguments besides the topic are passed as arguments to the handler
Результат void

subscribe() публичный Метод

Subscribe to a topic
public subscribe ( string $topic, string | object $context, null | string $handler = null ) : Horde_PubSub_Handle
$topic string
$context string | object Function name, class name, or object instance
$handler null | string If $context is a class or object, the name of the method to call
Результат Horde_PubSub_Handle Pub-Sub handle (to allow later unsubscribe)

unsubscribe() публичный Метод

Unsubscribe a handler from a topic
public unsubscribe ( Horde_PubSub_Handle $handle ) : boolean
$handle Horde_PubSub_Handle
Результат boolean Returns true if topic and handle found, and unsubscribed; returns false if either topic or handle not found

Описание свойств

$_topics защищенное свойство

Subscribed topics and their handles
protected $_topics