I have a Product entry type that contains a field for Components (which are also products) and a field for Related Products (again, also Products). I want to be able to find a parent product from a Component, but using a relatedTo() gives me all the Products on which it is a Related Product as well.
Is there a way to specify which field you want to use with the relatedTo() method?
$product = Entry::find()->section('products')->relatedTo($component)->one();
Expected result = The parent product.
Actual result = A random product on which the component is a related item.
Of course, this was all working great until I just recently added the Related Products field.