PxEvent: Open source PHP Event library
The event library is based on the observer pattern and it is used by many other
Copernica libraries for triggering and processing events.
You can use this library in the following manner: if you create a class
and you want to fire events from that class (for example, when a property
changes or something else happens with an instance of that class), you
can use the PxEventSubject interface. Classes that implement this interface,
may fire events, and observers can attach themselves to such objects and
be notified whenever an event is fired.
Do you want to be notified about such events? You can do so by implementing
the PxEventObserver interface, and attach an object to a PxEventSubject
instance.
The events that are triggered are instances of the PxEvent class. You may
use this PxEvent class directly, or you can make your own classes that extend
from it.
When you're implementing the PxEventSubject interface, you need to store
references to all observers that want to be notified. The PxEventObserverCollection
is very useful for that.
