Not sure if I got your question. This query is an example of a fixed query. The preds have to be manually added to the query. There’s no way, as far as I know, to do it automatically.
As has() func doesn’t support multiple predicates as params or variables with predicates. You have to manually add it.