You are here

public function OgResolvedGroupCollection::hasGroup in Organic groups 8

Returns whether the given group has already been added.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $group: The group for which to check the existence.

Return value

bool TRUE if the group has already been added.

Overrides OgResolvedGroupCollectionInterface::hasGroup

File

src/OgResolvedGroupCollection.php, line 52

Class

OgResolvedGroupCollection
Contains a collection of groups discovered by OgGroupResolver plugins.

Namespace

Drupal\og

Code

public function hasGroup(ContentEntityInterface $group) {
  $key = $this
    ->generateKey($group);
  return array_key_exists($key, $this->groupInfo);
}