\RedBeanPHPObservable

Observable Base class for Observables

Summary

Methods
Properties
Constants
addEventListener()
signal()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$observers
N/A

Properties

$observers

$observers : array

Type

array

Methods

addEventListener()

addEventListener(string  $eventname, \RedBeanPHP\Observer  $observer) : void

Implementation of the Observer Pattern.

Adds an event listener to the observable object. First argument should be the name of the event you wish to listen for. Second argument should be the object that wants to be notified in case the event occurs.

Parameters

string $eventname

event identifier

\RedBeanPHP\Observer $observer

observer instance

signal()

signal(string  $eventname, mixed  $info) : void

Notifies listeners.

Sends the signal $eventname, the event identifier and a message object to all observers that have been registered to receive notification for this event. Part of the observer pattern implementation in RedBeanPHP.

Parameters

string $eventname

event you want signal

mixed $info

message object to send along