I'm trying to set up a basic class that will perform CRUDL operations (create, read, update, delete, list) as part of a web-app library. Obviously, these operations are very common in web-apps, whether it's users or content you're creating / managing, so it would be an important part of the app and I would like to make sure I get it right. I'm looking for the following functionality:
* Should work with a variety of objects (for instance users and blogposts)
* Should work with prepared statements (so the user-supplied values in the query should be provided separately)
* Preferably it should be capable of handling both single SQL queries as well as multiple (transactions).
I am unsure of the best way to implement this, I have found a lot of PHP examples that try to do stuff like: