Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? |
[eluser]peterphp[/eluser]
Hi, I spent quite a while now playing around with Jamie Rumbelow's Flare O/R Mapper for CI (yesterday's version which is still labeled as version 0.1.0, but it now comes with some helpful code comments). After managing to get the example to work I started exploring into the more advanced features. Here are my results: 1) I managed to overload $primary_key with the column name of my table which is different to the default 'id'. I did it this way in my controller: Code: Customer::$primary_key = 'cid'; with table name: customers controller: customers model: customer_model Can anybody maybe give me a hint if this is the proper way to do the overloading? $primary_key is declared 'static' in the Flare lib: Code: /** I am asking because I am not very 'fluent' in OO. 2) After that success I expected it to be easy to also change the table that is queried as the doc comments state: Code: /** Unfortunately Code: Customer::$table = 'my_table_name'; did not work, there must be more to this which I could not figure out. 3) After being able to successfully retrieve all properties (columns) with Code: $this->data['post'] = Customer::find($id); I was pretty sure that Code: $this->data['post'] = Customer::find($id, array('select' => 'login_name')); would only return the 'login_name' property/column, but this didn't work either. Overall I am very impressed what is possible with Flare, I just need to get these things sorted out to start really working with it. So, maybe there are a few more advanced users here who can give me a little bit of help, that would be really nice and highly appreciated. |
Messages In This Thread |
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? - by El Forum - 12-16-2009, 06:26 PM
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? - by El Forum - 12-17-2009, 02:45 AM
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? - by El Forum - 12-17-2009, 08:29 AM
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? - by El Forum - 12-17-2009, 11:44 AM
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? - by El Forum - 12-17-2009, 11:56 AM
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? - by El Forum - 01-09-2010, 07:57 AM
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? - by El Forum - 01-09-2010, 08:33 AM
Jamie Rumbelow's Flare O/R Mapper for CI - anybody playing around with it? - by El Forum - 01-09-2010, 11:29 AM
|