/** * Creates the observer and attaches it to the observable subject object * * @param Observable $subject The observable object to attach the observer to */ function __construct(Observable &$subject) { // Attach this observer to the subject $subject->attach($this); // Store a reference to the subject object $this->subject = $subject; }