[wp-trac] [WordPress Trac] #19019: Reduce duplication in $wpdb

WordPress Trac noreply at wordpress.org
Mon Apr 22 19:53:28 UTC 2013


#19019: Reduce duplication in $wpdb
----------------------------------------+-----------------------------
 Reporter:  scribu                      |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Database                    |     Version:
 Severity:  minor                       |  Resolution:
 Keywords:  has-patch commit 3.7-early  |
----------------------------------------+-----------------------------
Changes (by nacin):

 * keywords:  has-patch commit 3.6-early => has-patch commit 3.7-early
 * milestone:  3.6 => Future Release


Comment:

 I think this is slightly over-abstracted. _insert_replace_helper is the
 only situation where we need values only. Let's keep that logic there,
 then have the new helper function drop the $values aspect. This would
 still then abstract out update() and delete().

 An alternative would be for the helper to return an array of formatted
 values, keyed by field. Then the formats stuff is abstracted, and each
 function just do a foreach with `$field => $value`. It might be ugly when
 put together, but it's an idea.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19019#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list