I have a tricky situation that I need some assistance. I am building a job search website and I’m using ClassExtender to add fields for the users (i.e candidates) that can be used to search for potential candidates. I have build a search form (using FormIt) to have the search filters that the employers will be using to find their potential candidate. These filters include multiple select checkboxes with fields such as: location, qualification, job type, job status, etc.
My issue is that now that I have captured what the array of fields + options for the employers, how can I convert it into a where JSON object that will be used with the GetExtUsers snippet that truly represents the search combinations?
For example, if the selected search filter are like…let’s say Miami, New York, Artist, Secretary, Fulltime, Parttime, I would assume the query should be like
(Miami or New York) AND (Artist or Secretary) AND (Fulltime or Parttime)???
Sometimes it’s easier to create a PHP array as you would for a MODX query’s where() statement (see this), then use $modx->toJSON on it to make the JSON you want, though your approach looks correct to me.