class JObservable extends JObject

Abstract observable class to implement the observer design pattern

Methods

__construct()

Constructor

mixed
getState()

Get the state of the JObservable object

array
notify()

Update each attached observer object and return an array of their return values

void
attach( object $observer)

Attach an observer object

boolean
detach( object $observer)

Detach an observer object

Details

__construct()

Constructor

Note: Make Sure it's not directly instantiated

mixed getState()

Get the state of the JObservable object

Return Value

mixed The state of the object.

array notify()

Update each attached observer object and return an array of their return values

Return Value

array Array of return values from the observers

void attach( object $observer)

Attach an observer object

Parameters

object $observer An observer object to attach

Return Value

void

boolean detach( object $observer)

Detach an observer object

Parameters

object $observer An observer object to detach.

Return Value

boolean True if the observer object was detached.