[wp-trac] [WordPress Trac] #21055: Interface for wpdb compatibility
WordPress Trac
wp-trac at lists.automattic.com
Sat Jun 23 22:15:29 UTC 2012
#21055: Interface for wpdb compatibility
-----------------------------+------------------------------
Reporter: santec | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version:
Severity: normal | Resolution:
Keywords: |
-----------------------------+------------------------------
Comment (by kurtpayne):
What if, instead of an interface, we used an abstract class?
{{{
abstract class wp_dao {
// common properties and methods
}
class wpdb extends wp_dao {
// concrete implentation
}
}}}
So things like `delete()` can be added into wp_dao and wpdb without
breaking back compat. Children don't have to implement these methods
unless they're explicitly marked abstract. Children can either inherit
from wpdb or wp_dao depending on their use case, and the code can still
use `$whatever instanceof wp_dao`?
Anybody currently extending wpdb would be unaffected.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21055#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list