I have a simple query:
$paidFeatures = Entry::find()
->section('paidFeatures')
->type(['simpleFeature', 'customFeature'])
->with(['relatedEntries'])
->status(['expired', 'disabled'])
->limit(10);
Some of the entries do not have relatedEntries linked/relationship setup.
I only want paidFeatures with linked/related relatedEntries ? So basically any entry in my paidFeatures list will always show a relatedEntries. No blanks.
I'm struggling to get my query to further filter linked/related relatedEntries.
UPDATE 1:
I've also tried this but doesnt give me what I want either:
$paidFeatures = Entry::find()
->section('paidFeatures')
->type(['simpleFeature', 'customFeature'])
//->with(['relatedEntries'])
//->relatedEntries('status:live')
->status(['expired', 'disabled'])
->all();
$paidFeaturesWithRelatedEntries = Entry::find()
->section('ideas')
->relatedTo($paidFeatures)
->all();
How can I do this?
->relatedEntries(':notempty:')is what I needed. Giving it a go now. Will report back. – Sean Delaney Feb 02 '22 at 15:20:notempty:in the docs but it didn't click. TBH I probably spent too long looking at the code, trying to resolve it myself that I started to overlook stuff. Thanks again! – Sean Delaney Feb 02 '22 at 16:05