class JObserverMapper

Observer mapping pattern implementation for Joomla

Methods

static  void
addObserverClassToClass( string $observerClass, string $observableClass, array|boolean $params = array())

Adds a mapping to observe $observerClass subjects with $observableClass observer/listener, attaching it on creation with $params on $observableClass instance creations

static  void
attachAllObservers( JObservableInterface $observableObject)

Attaches all applicable observers to an $observableObject

Details

static void addObserverClassToClass( string $observerClass, string $observableClass, array|boolean $params = array())

Adds a mapping to observe $observerClass subjects with $observableClass observer/listener, attaching it on creation with $params on $observableClass instance creations

Parameters

string $observerClass The name of the observer class (implementing JObserverInterface)
string $observableClass The name of the observable class (implementing JObservableInterface)
array|boolean $params The params to give to the JObserverInterface::createObserver() function, or false to remove mapping

Return Value

void

static void attachAllObservers( JObservableInterface $observableObject)

Attaches all applicable observers to an $observableObject

Parameters

JObservableInterface $observableObject The observable subject object

Return Value

void