Proposed new methods for Db_Table_Abstract

0 views
Skip to first unread message

Rich

unread,
Mar 11, 2009, 2:42:55 AM3/11/09
to Communit.as Development, Jaybill
I have these methods written for a couple modules, and I like them,
and I think they should be added to the core db table abstract.

Let me know what you think of these ideas...


fetchAllArray($where, $order, $limit, $page)
- Just like fetchAll(), except the output is always an array of
rows, or an empty array.

fetchRowArray($where)
- Same as above except it returns just one row as an array, or an
empty array.

getWhereClauseForKeywords($keywords, array $fieldnames)
- Creates a where clause based on supplied keywords and the names of
the fields to look in.

fetchAllArrayByKeywords($keywords, $fieldnames)
- Combines fetchAllArray with getWhereClauseForKeywords to perform a
keyword search.


It all ends up being relatively little code, and should not affect
existing implementations at all.

Rich

unread,
Mar 11, 2009, 2:58:20 AM3/11/09
to Communit.as Development
Changed my mind about one thing:

The field names array should just be a property instead of a variable
that's passed around. It probably rarely changes for each table, if
ever.

Jaybill McCarthy

unread,
Mar 11, 2009, 10:48:06 AM3/11/09
to communi...@googlegroups.com
works for me!

On Wed, Mar 11, 2009 at 7:45 AM, Jaybill McCarthy <hey...@jaybill.com> wrote:
Works for me.
Reply all
Reply to author
Forward
0 new messages