get_second_select_field_options_by_field( $field_id, $option_value_id, true ); } break; case 'search_tags': $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null; $fieldId = isset($_REQUEST['field_id']) ? $_REQUEST['field_id'] : null; $tag = isset($_REQUEST['tag']) ? $_REQUEST['tag'] : null; $extraFieldOption = new ExtraFieldOption($type); $result = []; $tags = Database::getManager() ->getRepository('ChamiloCoreBundle:Tag') ->createQueryBuilder('t') ->where("t.tag LIKE :tag") ->andWhere('t.fieldId = :field') ->setParameter('field', $fieldId) ->setParameter('tag', "$tag%") ->getQuery() ->getResult(); foreach ($tags as $tag) { $result[] = [ 'caption' => $tag->getTag(), 'value' => $tag->getTag() ]; } echo json_encode($result); break; default: exit; break; } exit;