We are having a discussion on the API group about the current limitations of the framework used in civicrm for the ORM and DB layer (pear DB_DataObject and DB... ).
If you are not familiar with the BAO/DAO structure, you might want to read this blog post (written in 2006) first.
Beside a general dislike of the existing framework that show its age, we have identified several issues:
2 years ago, a new framework has been evaluated and the proposal was to switch to doctrine.
Today, the database abstration layer of drupal7 is an independant project that could be used by civicrm too.
As this is a fairly big change that will last for years, we would like to have as many input as possible so we are choosing the best available solution today, and that will still be a good one in 2019.
I know that most ORM are able to handle the trivial CRUD, but we need one that would allow us to handle more complex queries.
The starting point was the contribution get API. We need, based on the requested fields to be returned to be able to join the contribution to the contact, to the address, email, phone of the contact, to the membership linked to the contribution, to the event linked to the contribution.
Given the complex database shema, would it be possible to generate the needed query with only the needed jointures, without having to write the sql directly?
What is your experience with existing frameworks (propel, doctrine, redbean, Kohana ) ? Anything you'd like to promote as the best solution?