Creating a model that relates to the same model


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


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:


Thanks, will try.