@dresden_phoenix: Good stuff.
My current implementation is a bit abstracted, meaning the public interface tries to focus on the data that needs to be manipulated, and on the actual manipulation that I want to do (fetch from the database, alter, insert, delete). I let the back end of the class methods worry about implementation. This way if I need to switch databases I can just alter the back end and not have to worry about changing the way I interact with it (that's the plan at least).
Here's an example of how you would use it:
$tableName = 'users';
$tableData = [
'first_name' => 'John',
'last_name' => 'Doe',
I've come come to the conclusion lately that this is still very specific to the storage type (a MySQL table in this case), the how the data is represented in the storage type (columns and rows) and the method of data manipulation (sql queries).
I'm researching right now so I can design a way to pull back even farther from the back end implementation and just focus on what the developer wants to do with the data.
Here's an example of what I'd like the end results to look like:
$entity = new Entity('user'); // The type of thing that's represented. Could be anything, i.e. a user, a blog post, a poll, a session cookie, an ad, etc...
$entity->list('firstName'); // Will create an array of all first names in the persistent storage
'firstName' => 'John',
'lastName' = 'Doe'
$entity->remove->(['lastName' => 'Doe']);
This is a very simplistic example, and will probably not be anything like the end result of what I create, but if you'll notice, this could actually be used on any persistent storage system, i.e. sql database, NoSQL database, xml files, json, yaml, flat file, any cloud service, etc...
All you need to do is make and alter the back end for the storage system without having to change your production code. It also makes things easier for the developer, because now you only have to focus on what data you have, and on what you need to do with it, not on how to do those manipulations.
One issue that I'm concerned with is advanced queries where you have multiple data sources and need to relate them in a complicated manner, like using complicated queries and joins. Right now the best solution I have thought of was to have some type of interface where you can tap into the actual storage system and manipulate what you need to, but I might be able to come up with a more abstract and flexible way that's independent of the storage system in use.