If i have a Model DebatePage which has the following many many relationship:
private static $many_many = array(
'Panelists' => 'Panelist'
);
and the panelist has a text field called "Name"
How can i query for all the debates that have a panelist called bob?
DebatePage::get()->filter('Panelist.Name:partialmatch', $keyword);
but i get an unknown column error
I was nearly there
DebatePage::get()->filter('Panelists.Name:partialmatch', $keyword);
So I just needed to use the relationship name, not singularised. Amazing how good SS data model is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With