Skip to content

Commit

Permalink
Declare relations
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Apr 24, 2024
1 parent 1f6f7bd commit 47567ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion inc/relation.constant.php
Original file line number Diff line number Diff line change
Expand Up @@ -1781,4 +1781,11 @@
$RELATION[$source_table][$target_table_key][] = ['itemtype_asset', 'items_id_asset'];
}

// TODO linkgroup + linktechgroup automatic mapping
// Multiple groups assignments
$assignable_itemtypes = array_unique(array_merge($CFG_GLPI['linkgroup_types'], $CFG_GLPI['linkgroup_tech_types']));
foreach ($assignable_itemtypes as $assignable_itemtype) {
$source_table_key = $assignable_itemtype::getTable();

$define_mapping_entry($source_table_key, '_glpi_groups_items');
$RELATION[$source_table_key]['_glpi_groups_items'][] = ['itemtype', 'items_id'];
}

0 comments on commit 47567ad

Please sign in to comment.