You are here

public function Context::setGroup in Context 8.4

Same name and namespace in other branches
  1. 8 src/Entity/Context.php \Drupal\context\Entity\Context::setGroup()
  2. 8.0 src/Entity/Context.php \Drupal\context\Entity\Context::setGroup()

Set the group this context should belong to.

Parameters

null|string $group: The name of the group to set.

Return value

$this This Context object.

Overrides ContextInterface::setGroup

File

src/Entity/Context.php, line 215

Class

Context
Defines the Context entity.

Namespace

Drupal\context\Entity

Code

public function setGroup($group) {
  $this->group = is_string($group) && !empty($group) ? $group : self::CONTEXT_GROUP_NONE;
  return $this;
}