It is possible to good object-relational-mapping library for PHP?
I understand of PDO/ADO, however they appear to simply provide abstraction of variations between database suppliers no actual mapping between your domain model and also the relational model. I am searching for a PHP library that functions much like the way in which Hibernate does for Java and .Internet.
Perhaps you have looked directly into Doctrine?
Also, take a look at Xyster.. It's in line with the Data Mapper pattern.
Also have a look at DataMapper versus. Active Record
try RedBean, its requires no configuration, no database (it produces everything quickly), no models etc. It even does all of the securing and transactions for you personally and monitors performance without anyone's knowledge (Heck! it even does garbage collection....) on top of that... you do not have to create just one... type of code.. http://redbeanphp.com Jesus this orm layer saved me ass!
I have been developing Pork.dbObject by myself. (an easy PHP orm / Active Record implementation) The primary reason is the fact that i've found most orms's overweight.
The primary considered Pork.dbObejct will be light-weight and straightforward to setup. No couple of xml file, only one function get in touch with the constructor to bind it, as well as an addRelation or addCustomRelation to define a regards to another dbObject.
Check it out: Pork.dbObject
Axon ORM is area of the Body fat-Free Framework - it features an on-the-fly mapper. No code machines. No stupid XML/YAML configuration files. It reads the database schema from the after sales, so in many CRUD procedures you do not even need to extend basics model. It really works with all of major PDO-supported database engines: MySQL, SQLite, MSSQL/Sybase, Oracle, PostgreSQL, etc.
/* SQL */ CREATE TABLE items ( product_id INTEGER, description VARCHAR(128), PRIMARY KEY (product_id) ) /* PHP */ // Create $product=new Axon('products') // instantly reads the above mentioned schema $product->product_id=123 $product->description='Sofa bed' $product->save() // ORM knows it is a new record // Retrieve $product->load('product_id=123') echo $product->description // Update $product->description='A better sofa bed' $product->save() // ORM knows this is an existing record // Remove $product->erase()
First and foremost, the plug-in and associated SQL data access layer are simply as lightweight because the framework: 14KB (Axon) + 6KB (SQLdb). Body fat-Free is simply 55KB.
Try Doctrine2, it's most likely probably the most powerfull ORM tool for PHP. I am mentioning it individually from Doctrine 1, since it is different software program. It has been rewritten on your own, still in beta phase, but it is functional now and developed.
It is extremely complex ORM, but smartly designed. Large amount of miracle from original Doctrine 1 disappeared. It offers complete solution, you are able to write your personal ORM on the top of Doctrine2 or use one of it's layers.
Take a look at Outlet ORM. It's simpler than Propel and Doctrine and delay pills work much like Hibernate, just with much more of a PHP feel into it.