I want to query some entries in a section.
I am able to write a query using a GET Param as a filter on the title field. If I want to query a custom field however I need to know the precise column otherwise craft yells at me.
How do I get to this information?
The following code is a very basic example of what I mean.
$request = Craft::$app->request;
$query = Entry::find()->section('profiles');
if($request->getParam('name')){
$param = $request->getParam('name');
$query->orWhere(['like', '`content`.`title`', $param]);
$query->orWhere(['like', '`content`.`field_nationality_gkpaccfs`', $param]);
}
return $query->all();
Or is there a better alternative on how to query entries on multiple properties? I know that $query->title(...) would work, but I do not know how to chain multiple of those together using OR.