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.
Wednesday, November 28, 2012
Thursday, November 8, 2012
Zend Framework 2 and ActiveRecord
I googled for adding php ActiveRecord in zend framework 2 but could not find it. However Arthur Bodera proposed the activerecord for zend framework 2 but it is not yet in Zend library. So i have decided to integrate standalone php ActiveRecord in zf2 as a third party library.
I have used zf2's tool to generated autoload classmap for activerecord that includes all ActiveRecord library files inside one file autoload_classmap.php. But activerecord has one file Utils.php, that include some functions outside class definition. The autoload classmap loader only find class methods not any function outside class, so i changed the Utils.php file and put all the outside functions into class and changed accordingly throughout the activerecord library. So if you wish to change the ActiveRecord library then please change Utils.php file accordingly.
You can find the complete code with zend framework 2 skeleton application here. Please put the zf2 library inside vendor directory.
I have used zf2's tool to generated autoload classmap for activerecord that includes all ActiveRecord library files inside one file autoload_classmap.php. But activerecord has one file Utils.php, that include some functions outside class definition. The autoload classmap loader only find class methods not any function outside class, so i changed the Utils.php file and put all the outside functions into class and changed accordingly throughout the activerecord library. So if you wish to change the ActiveRecord library then please change Utils.php file accordingly.
You can find the complete code with zend framework 2 skeleton application here. Please put the zf2 library inside vendor directory.
Labels:
ActiveRecord,
PHP,
zend framework 2,
zf2 ActiveRecord
Subscribe to:
Posts (Atom)