You are here

public function OgResolvedGroupCollectionInterface::addGroup in Organic groups 8

Adds a group to the collection.

Groups can be added multiple times by different OgGroupResolver plugins. Each time it is added a 'vote' will be cast in its favor, increasing the chance this group will be chosen as the group context.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $group: The group to add.

string[] $cache_contexts: An optional array of cache contexts to assign to the group.

int $weight: The weight to assign to this vote. If omitted the default weight will be used that is set with ::setVoteWeight().

1 method overrides OgResolvedGroupCollectionInterface::addGroup()
OgResolvedGroupCollection::addGroup in src/OgResolvedGroupCollection.php
Adds a group to the collection.

File

src/OgResolvedGroupCollectionInterface.php, line 62

Class

OgResolvedGroupCollectionInterface
Interface for classes providing a collection of resolved groups.

Namespace

Drupal\og

Code

public function addGroup(ContentEntityInterface $group, array $cache_contexts = [], $weight = NULL);