request->getStringParam('term'); $task_id = $this->request->getIntegerParam('task_id'); $subtaskQuery = new QueryBuilder(); $subtaskQuery->withQuery($this->db ->table(SubtaskModel::TABLE) ->eq('task_id', $task_id) ->columns(SubtaskModel::TABLE.'*')); if (ctype_digit($search)) { $subtaskQuery->withFilter(new SubtaskIdFilter($search)); } else { $subtaskQuery->withFilter(new SubtaskTitleFilter($search)); } $this->response->json($subtaskQuery->format(new SubtaskAutoCompleteFormatter($this->container))); } }