interface 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 fron JObservableInterface::attachObserver

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 fron JObservableInterface::attachObserver

Parameters

JObserverInterface $observer The observer object

Return Value

void

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