Mickael,
Thanks for clearing this error. I took a peek in the Model parent class and it indeed does not have any ties to a DB implementation. It just accepts libraries to be loaded into it, so a CouchDB library would fit as well as the shipped DB classes do. Cheers,. On Wednesday 14 April 2010 14:46:19 [email protected] wrote: > Hello Martin, > > I'm familiar with the CodeIgniter PHP Framework and, without disrespect to > Markus, the model implementation is by NO WAY tied to an RDBM. > > If you look at the user guide (beautiful by the way) > http://codeigniter.com/user_guide/general/models.html : > > > class Blogmodel extends Model { > > var $title = ''; > var $content = ''; > var $date = ''; > > function Blogmodel() > { > // Call the Model constructor > parent::Model(); > } > > function get_last_ten_entries() > { > $query = $this->db->get('entries', 10); > return $query->result(); > } > > function insert_entry() > { > $this->title = $_POST['title']; // please read the below note > $this->content = $_POST['content']; > $this->date = time(); > > $this->db->insert('entries', $this); > } > > function update_entry() > { > $this->title = $_POST['title']; > $this->content = $_POST['content']; > $this->date = time(); > > $this->db->update('entries', $this, array('id' => $_POST['id'])); > } > > } > > > you see pretty clearly that all db stuff is implemented inside the model, > and there is no automatic mapping. So you can imagine : > > > class Blogmodel extends Model { > > var $title = ''; > var $content = ''; > var $date = ''; > > function Blogmodel() > { > // Call the Model constructor > parent::Model(); > } > > function get_last_ten_entries() > { > $query = > $this->couchdb->limit(10)->descending(true)->getView('blog','by-date'); > return $query->rows; > } > > [...] > } > > > Mickael > > > ----- Mail Original ----- > De: "Martin Kirchgessner" <[email protected]> > À: [email protected] > Envoyé: Mardi 13 Avril 2010 20h23:14 GMT +01:00 Amsterdam / Berlin / Berne > / Rome / Stockholm / Vienne Objet: Searching a schema-free-friendly PHP > framework > > Hi everyone, > > > I know this topic is not directly couchdb-related, but I hope some > others couchdb users are using PHP... > > I'm currently using PHP/MySQL and seriously considering to relax with > CouchDB. So far I'm developping with the CakePHP framework (a rails- > like, in PHP). I tried to implement a new datasource to bind > seamlessly my models to CouchDB documents instead of MySQL tables. > However it turns out that schemas are deeply used in Cake models' > internals ... Does anyone know a more "schema-free-friendly" PHP > framework? > > Thanks for suggestions, > > > Martin > Markus Jelsma - Technisch Architect - Buyways BV http://www.linkedin.com/in/markus17 050-8536620 / 06-50258350
