Attach Relation

Is it possible in Yii2 to attach an AR relation in a behavior as we could in Yii 1? If so, how is it done?

In Yii one we could attach a relation, with query conditions and thus using $model->find() or findAll() would result in a query including a join for the relation and it’s attributes.

see this

Thank you Orey - I was just reading about getters in Yii and something clicked. Your link is very useful.