You are here

interface GroupHierarchyManagerInterface in Subgroup (Graph) 1.0.x

An interface for the group hierarchy manager.

Hierarchy

Expanded class hierarchy of GroupHierarchyManagerInterface

All classes that implement GroupHierarchyManagerInterface

1 file declares its use of GroupHierarchyManagerInterface
GroupSubgroupConstraintValidator.php in src/Plugin/Validation/Constraint/GroupSubgroupConstraintValidator.php

File

src/GroupHierarchyManagerInterface.php, line 11

Namespace

Drupal\ggroup
View source
interface GroupHierarchyManagerInterface {

  /**
   * Relates one group to another as a subgroup.
   *
   * @param \Drupal\group\Entity\GroupContentInterface $group_content
   *   The group content representing the subgroup relationship.
   */
  public function addSubgroup(GroupContentInterface $group_content);

  /**
   * Removes the relationship of a subgroup.
   *
   * @param \Drupal\group\Entity\GroupContentInterface $group_content
   *   The group content representing the subgroup relationship.
   */
  public function removeSubgroup(GroupContentInterface $group_content);

  /**
   * Checks if a group has a subgroup anywhere in its descendents.
   *
   * @param \Drupal\group\Entity\GroupInterface $group
   *   The parent group whose subgroups will be checked.
   * @param \Drupal\group\Entity\GroupInterface $subgroup
   *   The subgroup that will be searched for within the parent group's
   *   subgroups.
   *
   * @return bool
   *   TRUE if the given group has the given subgroup, or FALSE if not.
   */
  public function groupHasSubgroup(GroupInterface $group, GroupInterface $subgroup);

  /**
   * Loads the subgroups of a given group.
   *
   * @param int $group_id
   *   The group for which subgroups will be loaded.
   *
   * @return \Drupal\group\Entity\GroupInterface[]
   *   An array of subgroups for the given group.
   */
  public function getGroupSubgroups($group_id);

  /**
   * Gets the IDs of the subgroups of a given group.
   *
   * @param int $group_id
   *   The group for which subgroups will be loaded.
   *
   * @return int[]
   *   An array of subgroup IDs for the given group.
   */
  public function getGroupSubgroupIds($group_id);

  /**
   * Loads the supergroups of a given group.
   *
   * @param int $group_id
   *   The group for which supergroups will be loaded.
   *
   * @return \Drupal\group\Entity\GroupInterface[]
   *   An array of supergroups for the given group.
   */
  public function getGroupSupergroups($group_id);

  /**
   * Gets the IDs of the supergroups of a given group.
   *
   * @param int $group_id
   *   The group for which supergroups will be loaded.
   *
   * @return int[]
   *   An array of supergroup IDs for the given group.
   */
  public function getGroupSupergroupIds($group_id);

}

Members

Namesort descending Modifiers Type Description Overrides
GroupHierarchyManagerInterface::addSubgroup public function Relates one group to another as a subgroup. 1
GroupHierarchyManagerInterface::getGroupSubgroupIds public function Gets the IDs of the subgroups of a given group. 1
GroupHierarchyManagerInterface::getGroupSubgroups public function Loads the subgroups of a given group. 1
GroupHierarchyManagerInterface::getGroupSupergroupIds public function Gets the IDs of the supergroups of a given group. 1
GroupHierarchyManagerInterface::getGroupSupergroups public function Loads the supergroups of a given group. 1
GroupHierarchyManagerInterface::groupHasSubgroup public function Checks if a group has a subgroup anywhere in its descendents. 1
GroupHierarchyManagerInterface::removeSubgroup public function Removes the relationship of a subgroup. 1