LnBlogObject
LnBlogObject
Blog
Entry
FileUpload
LnBlogXMLConfig
and 4 other children

A base object which is event-aware, i.e. it knows how to create, register, and fire events.  It also has contains other general-purpose methods, such as simple XML serialization.

Functions
createEvent
public function createEvent(
$name
)

Creates an event for the current class.

Parameters
name

The name of the event.

Returns

True on success, false on failure.

hasEvent
public function hasEvent(
$name
)

Determine whether the given event exists.

Parameters
name

The name of the event.

Returns

True on success, false on failure.

hasHandlers
public function hasHandlers(
$name
)

Determine if thereare any handlers for the given event.

Parameters
name

The name of the event.

Returns

True on success, false on failure.

raiseEvent
public function raiseEvent(
$name
)

Raises the given event name for this class.

Parameters
name

The name of the event.

params

Any number of additional parameters may be passed to this method.

Returns

True on success, false on failure.

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

Registers a handler for an event of this class.

Parameters
type

The class of the class that raises the event.

name

The name of the event.

func

The name of the function that will handle this event.

Returns

True on success, false on failure.

registerStaticEventHandler
public 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
type

The class of the class that raises the event.

name

The name of the event.

func

The name of the function that will handle this event.

Returns

True on success, false on failure.

See Also

registerEventHandler

serializeXML
public function serializeXML()

Performs a simple XML serialization of the object.  If the object has an exclude_fields which is an array, then the method will NOT include that property in the serialization.  In addition, it will not include any properties whose name matches an item in the exclude_fields array.

Returns

A string containing an XML representation of the object.

deserializeXML
public function deserializeXML(
$xmldata
)

Populates the object's properties from a string of XML data.

Parameters
xmldata

The XML containing a serialized representation of the object.  This is typically the string generated by serializeXML and can be either a string of data or a path to the data file.