... | ... | @@ -35,14 +35,15 @@ Once introduced the list of options you want, and to add the dynamic select list |
|
|
2. Create the query function at the module: Ex. (guifi.module)\
|
|
|
`function imgroup_select(FieldStorageConfig $definition, ContentEntityInterface $entity = NULL, $cacheable) {`
|
|
|
|
|
|
` $database = \Drupal::database();`\
|
|
|
` ` $query = $database->query(`"SELECT field_key_value, title `\
|
|
|
`$database = \Drupal::database();`\
|
|
|
` `$query = $database->query(`"SELECT field_key_value, title `\
|
|
|
<span dir="">FROM {guifi__field_type} t, {guifi__field_weight} w, {guifi_field_data} l, {guifi__field_key} k </span>\
|
|
|
`WHERE t.field_type_value = 'im_groups' `\
|
|
|
` AND t.entity_id = w.entity_id AND w.entity_id=l.id AND w.entity_id=k.entity_id AND `\
|
|
|
` ` w.bundle='guifi_options' AND l.bundle='guifi_options' AND k.bundle='guifi_options' AND\
|
|
|
`w.entity_id=l.id AND w.entity_id=k.entity_id `\
|
|
|
` ` ORDER BY w.field_weight_value, title");\
|
|
|
` AND t.entity_id = w.entity_id AND w.entity_id=l.id `\
|
|
|
` AND w.entity_id=k.entity_id AND`w.bundle='guifi_options' \
|
|
|
AND l.bundle='guifi_options' AND k.bundle='guifi_options' \
|
|
|
AND`w.entity_id=l.id AND w.entity_id=k.entity_id `\
|
|
|
ORDER BY w.field_weight_value, title");\
|
|
|
$result = $query->fetchAllKeyed(0,1);\
|
|
|
return $result;\
|
|
|
}
|
... | ... | |