protected function SqlGroupGraphStorage::getEdgeId in Subgroup (Graph) 1.0.x
Gets the edge ID relating the parent group to the child group.
Parameters
int $parent_group_id: The ID of the parent group.
int $child_group_id: The ID of the child group.
Return value
int The ID of the edge relating the parent group to the child group.
2 calls to SqlGroupGraphStorage::getEdgeId()
- SqlGroupGraphStorage::addEdge in src/
Graph/ SqlGroupGraphStorage.php - Relates the parent group and the child group.
- SqlGroupGraphStorage::removeEdge in src/
Graph/ SqlGroupGraphStorage.php - Removes the relationship between the parent group and the child group.
File
- src/
Graph/ SqlGroupGraphStorage.php, line 238
Class
- SqlGroupGraphStorage
- SQL based storage of the group relationship graph.
Namespace
Drupal\ggroup\GraphCode
protected function getEdgeId($parent_group_id, $child_group_id) {
$query = $this->connection
->select('group_graph', 'gg')
->fields('gg', [
'id',
]);
$query
->condition('start_vertex', $parent_group_id);
$query
->condition('end_vertex', $child_group_id);
$query
->condition('hops', 0);
return $query
->execute()
->fetchField();
}