PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #340

Feature Request: Events

Details

Submitted2003-12-03 10:07 UTC
Fromthomas at unifiedconsulting dot com
StatusBogus
PackageDB_DataObject
PHP Version4.3.3
OSRHEL 3
Roadmaps(Not assigned)

Comments

[2003-12-03 10:07 UTC] thomas at unifiedconsulting dot com

Description:
------------
It would be nice if you could define functions that would be executed before/after certain events (saving, loading, etc). For instance, I'd like to extend one of my dataobject classes to include some calculated fields that would be initialized whenever a function that loads a new record into the dataobject is called.
IMHO, the best way to do this would be to decide on some function names like afterLoad(), beforeSave(), etc, and then use method_exist() to check if these methods are defined. If they are, call them, and if not, just ignore them.