incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mickael.bai...@free.fr
Subject Re: Searching a schema-free-friendly PHP framework
Date Wed, 14 Apr 2010 12:46:19 GMT

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" <martin.kirchgessner@orego.fr>
À: user@couchdb.apache.org
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

Mime
View raw message