Home » Database » DB_DataObject » Bug #6382
Allow for DB_DataObject extensions
Details
| Request #6382 | Allow for DB_DataObject extensions |
|---|---|
| Submitted | 2005-12-31 15:15 UTC |
| From | mike dot brittain at embimedia dot com |
| Status | Feedback |
| Package | DB_DataObject |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-12-31 15:15 UTC] mike dot brittain at embimedia dot com
Description:
------------
I like the style of DB_DataObject, but there are some custom methods I want to add to the interface. Based on your comments in other bugs, I recognize that you want to keep the API tight, and I agree with that.
Specifically, I want to be to add helper methods similar to what is suggested in bug 5790. Aside from "store()", I have overridden update and insert to automatically set values for meta columns on each of my tables such as "created_time" and "modified_time". I don't think that this is the sort of stuff that the standard application logic should include -- my preference is to keep it in the database layer.
So far, I've extended DB_DataObject to CustomDataObject -- but haven't touched the Generator class or factory methods. I don't want to branch from DB_DataObject or lose the ability to update the PEAR package.
A fairly big problem I've got in my implementation is that I'm no longer relying on the factory method, instead calling the table-based classes directly.
The ability to extend a custom DataObject from DB_DataObject should take care of other feature requests for adding methods to the API.