Trying to make models in Kohana, relations problem.

Posted by Asaf on Stack Overflow See other posts from Stack Overflow or by Asaf
Published on 2010-06-15T15:55:41Z Indexed on 2010/06/16 0:12 UTC
Read the original article Hit count: 113

Filed under:
|
|

I have a table of Hits, Articles and Categories
Now, a Hit belongs_to an Article/Category (depends on where it was done).
so I have a column on Hits table with the name 'parenttype'
That tells me 'Article' or 'Category'.
I wrote in the Hit model (extends ORM)

protected $_belongs_to= array(
    'page' => array('model'=> $this->parenttype)
    );

Now it complains about $this->parenttype not being expected?

© Stack Overflow or respective owner

Related posts about orm

Related posts about kohana