« Return to Thread: New ideas/questions for Zend_Db_Table

New ideas/questions for Zend_Db_Table

by dinok :: Rate this Message:

Reply to Author | View in Thread

Hi all,

I am currently working on some improvements for Zend_Db_Table.
These improvements provide an easier and faster way for database relationships.
As I've often seen, many people want to be able to use JOINs and other things.

So my improvements are:
- enable JOINs for one to one relationships
- enable preFetch for one to many relationships (one SELECT for all related, php assigns each record to the related table
- easy way to cache complete objects with relations
- some kind of a singleton implementation for TableClasses (static class like the registry? or get instance in each table class)


The first two points are working in a early status, but now my problem:
If I got a resultset with 10 rows and each of these rows(e.g. users)  owns zero, one or many related rows (e.g. email addresses), I always put references of the tables in the rowsets.
This has two negative consquences. One the one hand, the memory is unnessesary spent and on the other hand you are not able to keep the related objecs small (e.g. for caching).
So why don't we build a connection manager, which holds each table and we just refer to the TableClassName instead of the instance?
And just if we need the table (manipulating rows), we get the reference from the connection manager.

Is this a good idea or do I miss anything?

Best regards

 « Return to Thread: New ideas/questions for Zend_Db_Table