orm - Trying to make models in Kohana, relations problem -


I have a table of hits, articles and categories - now, one hit is for a paragraph / category (where Depending on it was done).
So I have a column on the hit table with a name 'parentype' - which tells me 'paragraph' or 'category'
I wrote in hit model (raises ORM)

  safe $ _belongs_to = array ('page' = & gt; array ('model' =>> $ this-> parenttype));  

Now this is not expected about complain-> parenplype about $?

You must declare variable protected $ _belongs_to = NULL;

and the original class constructor on the constructor is set after calling

  public function __construct () {parent: __ creation (); $ This- & gt; _belongs_to = Array ('page' = & gt; array ('model' => = this- & gt; carpetrepe);) }  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -