I'm having real problems with the following topic:
I'm creating a social network using Yii framework and for each user I'm generating a bunch of DB tables that start with the user id, so a DB table looks like: 13_my_firends.
The point is that by doing this, I cannot generate a certain model using the gii tool, and I really need some models for this tables to make some relations to avoid inner joins, so I guess the problem is like this:
-> How can I create a model file using php or Yii code and also, within that code alter the "public function relation(){}" method to add my relations?
EDIT:
I was just thinking about this: Is there a possibility to add the relation to the parent and not the son? What I mean is... Can I alter the main DB table (witch in my case is sys_accounts - this one has a model) like: -> call the relations() method in another method -> make the relations array (kind of like a join)
So basically it's like... altering the relations() method only when I want to. Is it possible? And if so, how?