ActiveRecord query

hi all! Tell me please how to add ‘exists’ condition in ActiveRecord query:

$rs = Zmcat::find()->where([‘like’, ‘name’, “%$term%”, false])->all();
I want to add this thing: ’ and exists (select null from zm_cat_ed where zm_cat_ed.zm_cat_id = zm_cat.id and zm_cat_ed.price is not null)’.

models relations: Zmcat->hasMany(Zmcated)

$rs = Zmcat::find()->where([‘like’, ‘name’, “%$term%”, false])->andWhere(‘exists (select null from zm_cat_ed where zm_cat_ed.zm_cat_id = zm_cat.id and zm_cat_ed.price is not null)’)->all();
works but looks not very well

something like this (pseudo):
$rs = Zmcat::find()->where([‘like’, ‘name’, “%$term%”, false])->andWhere([‘exists’, Zmcat->child(Zmcated::findOne()->where(‘price’=> not null))])->all();