Trying to figure out if this is possible in 1 step. I want to return locations that have a related entry in the relatedMerchant field, but I'd also want to make sure that a field in the relatedMerchant entry has a value...
$locationsRelatedToCategories = Entry::find()
->section('locations')
->limit(100000)
->relatedTo([
// somewhat unrelated, but this entry should be related to a specific category
'targetElement' => $categoryElement, 'field' => 'locationOffers.category'
])
->relatedMerchant(':notempty:') // has to have a related merchant
// somewhere here, how can I return only relatedMerchant entries where relatedMerchant.someField :notempty:
->all();