diff --git a/libraries/joomla/observer/updater.php b/libraries/joomla/observer/updater.php index 14f84f09d062a..4131f1a3abf64 100644 --- a/libraries/joomla/observer/updater.php +++ b/libraries/joomla/observer/updater.php @@ -46,7 +46,7 @@ public function __construct(JObservableInterface $observable) /** * Adds an observer to the JObservableInterface instance updated by this - * This method can be called fron JObservableInterface::attachObserver + * This method can be called from JObservableInterface::attachObserver * * @param JObserverInterface $observer The observer object * @@ -59,6 +59,24 @@ public function attachObserver(JObserverInterface $observer) $this->observers[get_class($observer)] = $observer; } + /** + * Removes an observer from the JObservableInterface instance updated by this + * This method can be called from JObservableInterface::attachObserver + * + * @param String $observer The observer class name + * + * @return void + * + * @since 3.6.0 + */ + public function detachObserver($observer) + { + if (isset($this->observers[$observer])) + { + unset($this->observers[$observer]); + } + } + /** * Gets the instance of the observer of class $observerClass *