Without unused words, I need some advice.
I'm building another app basing on KohanaPHP 3.0.9 framework, felt in love with ORM (Real productivity booster!).
I got Model_User model:
class Model_User extends ORM
{
protected $_table_name = 'users';
protected $_primary_key = 'id';
protected $_has_many = array(
'articles' => array(
'through' => 'users_articles',
),
);
protected $_ignored_columns = array('articles');
}
I have gone with thin controller/fat model philosophy so the correct place for data is model in my development.
What is $_ignored_columns? In few places I need to return $user object so I'm returning it with articles (when needed) as $user method: $user->articles->find_all();
So far so good, everything is working really perfectly. I'm not quite sure if my approach with $_ignored_columns is correct, if not, please let me know with advice how to solve it.
However, I'm facing an issue with caching. Generally, everything is working correctly expect articles. It just gets ignored by cache (not saved in cache file). I also tried to cache it separately - still without luck.
Any suggestions?