LnBlogObject

A base object which is event-aware, i.e. it knows how to create, register, and fire events.

Summary
A base object which is event-aware, i.e.
Creates an event for the current class.
Determine whether the given event exists.
Determine if thereare any handlers for the given event.
Raises the given event name for this class.
Registers a handler for an event of this class.
Registers a static handler for an event of this class.

Functions

createEvent

function createEvent($name)

Creates an event for the current class.

Parameters

nameThe name of the event.

Returns

True on success, false on failure.

hasEvent

function hasEvent($name)

Determine whether the given event exists.

Parameters

nameThe name of the event.

Returns

True on success, false on failure.

hasHandlers

function hasHandlers($name)

Determine if thereare any handlers for the given event.

Parameters

nameThe name of the event.

Returns

True on success, false on failure.

raiseEvent

function raiseEvent($name)

Raises the given event name for this class.

Parameters

nameThe name of the event.

Returns

True on success, false on failure.

registerEventHandler

function registerEventHandler($type,
$name,
$func)

Registers a handler for an event of this class.

Parameters

typeThe class of the class that raises the event.
nameThe name of the event.
funcThe name of the function that will handle this event.

Returns

True on success, false on failure.

registerStaticEventHandler

function registerStaticEventHandler($type,
$name,
$func)

Registers a static handler for an event of this class.  Use this if your handler belongs to a class but does not require an instance of it in order to work.

Parameters

typeThe class of the class that raises the event.
nameThe name of the event.
funcThe name of the function that will handle this event.

Returns

True on success, false on failure.

See Also

registerEventHandler

function createEvent($name)
Creates an event for the current class.
function hasEvent($name)
Determine whether the given event exists.
function hasHandlers($name)
Determine if thereare any handlers for the given event.
function raiseEvent($name)
Raises the given event name for this class.
function registerEventHandler($type,
$name,
$func)
Registers a handler for an event of this class.
function registerStaticEventHandler($type,
$name,
$func)
Registers a static handler for an event of this class.