I spent sometime debugging the following situation:
I have a Gallery model with 4 relations: cover, pictures and creator.
When I run something like $gallery = Gallery::model()->findAll(), I got an array of pictures inside $gallery, and an User object inside $gallery->creator.
But $gallery->cover is just an integer, containing the ID of the object that (I think) should be there.
I found that, when you have a column with the same name of the relation (I had Gallery.cover = Picture.id and a ‘cover’ relation), the attribute will contain the value, not the object.
Shouldn’t the object have a higher priority instead of the simple column value?
Or a config to change that, I don’t know… Correct me if I’m wrong, but tell me why haha
Thank you in advance (: