| 7 | | I had seen and heard a lot about [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] and wanted to have some fun with it. As I'm mostly a PHP guy, I decided to roll out my own class. This is what I came up with. It never really made it to ''production'' so it's probably a bit rough, but I've learned a lot about the internals of AR and frankly, had a lot of fun programming this. It has support for renderer class extensions (ie: to generate an xml output), in model validation functions, etc. I've used the occasion to get accustomed with [http://xdebug.org/ xDebug], the PHP remote debugger. You can view a live example [http://code.mlalonde.net/dbtmp/v2.php here] (reload to see the effect). '''Note that this is test code and the errors are expected for debugging'''. See attached file for the source. |
| | 7 | I had seen and heard a lot about [http://en.wikipedia.org/wiki/Active_record_pattern Active Record] and wanted to have some fun with it. As I'm mostly a PHP guy, I decided to roll out my own class. This is what I came up with. It never really made it to ''production'' so it's probably a bit rough, but I've learned a lot about the internals of AR and frankly, had a lot of fun programming this. It has support for renderer class extensions (ie: to generate an xml output), in model validation functions, etc. I've used the occasion to get accustomed with [http://xdebug.org/ xDebug], the PHP remote debugger. You can view a live example [http://code.mlalonde.net/dbtmp/v2.php here] (reload to see the effect). |
| | 8 | |
| | 9 | '''Note that this is test code and the errors are expected for debugging'''. See attached file for the source. |