====== __construct ====== {#JAPI Joomla.Framework Base JObserver::__construct #} This is the class constructor. It performs two function: first, it registers itself with the subject so that the subject knows to notify this observer. Second, it sets up the subject property so that this object can reference the subject it is observing. ===== Syntax ===== JObserver __construct ( **&$subject** ) | **$subject** | string | is an object whose class is a child class of the JObservable class. | ===== Examples ===== The JEventDispatcher::register function instantiates a JObserver class (or subclass) by passing itself to the JObserver constructor: $this->attach(new $handler($this));