With the help of activeRecord I want to achieve the following.
There are nomenclature, they have events.
For example: Nomenclature Volleyball, and in her 3 events Nomenclature Football and in her 6 events.
I need to load the nomenclature and eagerly load the events to them. I do the following:
Nom::find()->with('event')->all(); But in the list there are nomenclature, within which there is not a single active event, such are not needed. I exclude them.
Nom::find()->joinWith('event') ->where(['event.is_active'=>1]) ->all(); Now items that have no active events are not selected. But there are nomenclature, which contain inactive events. Such activities do not need to display.
You need to somehow include the Where clause (is_active => 1) also for the Event table. How to do it?