Creating a model that relates to the same model

Hi,

I have made a DB table that has a parent_id column, how can I make the model relate to the same table / model?

James.

Have you tried something like this in the relations function?:


'parent' => array(self::BELONGS_TO,'ModelClass','parent_id') 

I never tried that but you then should be able to retrieve the parent like that:


$this->parent;

Thanks, will try.