class JObserverUpdater implements JObserverUpdaterInterface

Observer updater pattern implementation for Joomla

Methods

__construct( JObservableInterface $observable)

Constructor

void
attachObserver( JObserverInterface $observer)

Adds an observer to the JObservableInterface instance updated by this This method can be called from JObservableInterface::attachObserver

void
detachObserver( String $observer)

Removes an observer from the JObservableInterface instance updated by this This method can be called from JObservableInterface::attachObserver

JTableObserver|null
getObserverOfClass( string $observerClass)

Gets the instance of the observer of class $observerClass

void
update( string $event, array $params)

Call all observers for $event with $params

boolean
doCallObservers( boolean $enabled)

Enable/Disable calling of observers (this is useful when calling parent:: function

Details

__construct( JObservableInterface $observable)

Constructor

Parameters

JObservableInterface $observable The observable subject object

void attachObserver( JObserverInterface $observer)

Adds an observer to the JObservableInterface instance updated by this This method can be called from JObservableInterface::attachObserver

Parameters

JObserverInterface $observer The observer object

Return Value

void

void detachObserver( String $observer)

Removes an observer from the JObservableInterface instance updated by this This method can be called from JObservableInterface::attachObserver

Parameters

String $observer The observer class name

Return Value

void

JTableObserver|null getObserverOfClass( string $observerClass)

Gets the instance of the observer of class $observerClass

Parameters

string $observerClass The class name of the observer

Return Value

JTableObserver|null The observer object of this class if any

void update( string $event, array $params)

Call all observers for $event with $params

Parameters

string $event Event name (function name in observer)
array $params Params of event (params in observer function)

Return Value

void

boolean doCallObservers( boolean $enabled)

Enable/Disable calling of observers (this is useful when calling parent:: function

Parameters

boolean $enabled Enable (true) or Disable (false) the observer events

Return Value

boolean Returns old state