I have not written all the code, i have just modified the POLO'S version to make it work with Zendframework 2.0 stable release and phpActiveRecord and you can use this code with any other ORM if you wish. I have bundled the code with skeleton application rather then posting one by one file here. You can get the code from here.