findByPk gives all relations?

I stumbled over the fact that I can reach any backward related table when I used the


Model::model() -> findByPk(...);

so my question is if the method include all the related tables automaticly without invoking the with() method???

with() is not mandatory to bring in related records. Without it, related records are lazy loaded when needed.

http://www.yiiframework.com/doc/api/CActiveRecord#with-detail

/Tommy

Lazy loading means that it loads the information when I try to request it, thats the reason I can reach information that I thought a "with()" method needed to be invoked with?

Yes, you can read more here (section "Performing Relational Query")

http://www.yiiframework.com/doc/guide/database.arr

/Tommy