You are here

public function SqlGroupGraphStorage::getDescendants in Subgroup (Graph) 1.0.x

Gets all descendant child groups of the given parent group.

Parameters

int $group_id: The parent group ID.

Return value

int[] An array of descendant child group IDs.

Overrides GroupGraphStorageInterface::getDescendants

File

src/Graph/SqlGroupGraphStorage.php, line 521

Class

SqlGroupGraphStorage
SQL based storage of the group relationship graph.

Namespace

Drupal\ggroup\Graph

Code

public function getDescendants($group_id) {
  $this
    ->loadMap($group_id);
  return isset($this->descendants[$group_id]) ? $this->descendants[$group_id] : [];
}