Relations In Relations

is possible to use use relations on models that are related to other models?.. like this

model(1)->model(2)->model(3),model(4),model(5).

in model 1 can i use relations that are related in model 3 with 5?

Yes, but watch out for generated SQL.

In some cases you may want to use with() to fetch results in one query.

Also, define through relations at least for convenience.

http://www.yiiframework.com/doc/api/1.1/CActiveRelation#through-detail

Check out my extension: http://www.yiiframework.com/extension/relatedsearchbehavior/

And check out its demo (which you can download).

It makes using relations easier (especially with gridviews).

Of course its possible. If you haven’t read it yet, be sure to check the guide section on this.