public function SqlGroupGraphStorage::isDirectDescendant in Subgroup (Graph) 1.0.x
Checks if a group (A) is the direct descendant of another group (B).
Parameters
int $a: The group whose descent status will be checked.
int $b: The group for which descent status will be checked against.
Return value
bool TRUE if group A is a descendant of group B.
Overrides GroupGraphStorageInterface::isDirectDescendant
File
- src/
Graph/ SqlGroupGraphStorage.php, line 537
Class
- SqlGroupGraphStorage
- SQL based storage of the group relationship graph.
Namespace
Drupal\ggroup\GraphCode
public function isDirectDescendant($a, $b) {
$this
->loadMap($b);
return isset($this->directDescendants[$b]) ? in_array($a, $this->directDescendants[$b]) : FALSE;
}