findWith() method

Hi,

There is a method of yii\db\ActiveQueryTrait I do not fully understand.

The Docs say as follows:

I would really appreciate some more detailed explanation of the method purpose, preferably with code example of its actual usage.

Best regards!

Really - NOBODY ???

Looking at the source code, it seems to be used for internal purpose.

The method is implemented in ActiveQueryTrait and is called solely from ActiveQuery::populate(), which in tern called from ActiveQuery::one(), Query::all() and BatchQueryResult::fetchData().

If you have PhpStorm, you can open one of your projects using Yii2, open vendor/yii2/db/ActiveQueryTrait.php, right click on findWith() method and select “Find Usages” from the context menu. And you will find what I’ve just told. :)

Thank you - pity this is not mentioned in the documentation!