I have been using PHP OO capabilities for a while now, but not to it's full extent for what I've been recently reading.
I was just reading about some advantages of having data as instances of a class instead of having (multidimensional) arrays.
The code shown talked about an agnostic class to interact with the database. This class would have a "persist" method. It would receive an instance of Person, for example, and store it in my MySQL db, or SQL, or even simple text or xml.
The book talked about the use of interceptors to implement the "delegate pattern", which makes really easy to change the implementation of your storage class.
Since I'm going to start working in a big project, I wanted to start right and I wanted to have something like this in my code, where everything is an object.
I didn't know how to search for something like this, but is there a good tutorial or an existing (sample) of a class that would allow me to interact with my database in an agnostic way, allowing me to change the implementation easily and treating everything as an object?
[I know I'll have to do some of the implementation to have everything work with my custom classes, but a tutorial or some well-documented sample code would be great]
I will really appreciate any help!