[development] Core query object?

Scott Reynolds sdrreynolds at gmail.com
Sat Jul 22 17:32:33 UTC 2006


I was pondering this idea for my cre module. I am thinking about creating a
query object that would allow me (like the views one does) to add where
clauses and select different columns from different tables and do joins etc.
This would be useful for instance when recommending comments on a particular
node.

I would do something like (Plz ignore any mistakes in the code...)

comment_recommendation_recommendation_hook(&$query_obj)
{
    query_obj->add_table('comment');
    query_obj->add_where('comment.nid = ' . arg(1));
    ....
}

So it occured to me, is there such an obj in core and if there isnt should
there be one? I am not purposing to remove db_query and etc but rather an
object that implements those methods. Another dreaded layer of
abstraction....

~scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20060722/56e25dd7/attachment.htm


More information about the development mailing list