You are here

public function WebformAccessGroup::addEmail in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_access/src/Entity/WebformAccessGroup.php \Drupal\webform_access\Entity\WebformAccessGroup::addEmail()

Add email address to webform access group.

Parameters

string $email: An email address.

Return value

$this

Overrides WebformAccessGroupInterface::addEmail

File

modules/webform_access/src/Entity/WebformAccessGroup.php, line 288

Class

WebformAccessGroup
Defines the webform access group entity.

Namespace

Drupal\webform_access\Entity

Code

public function addEmail($email) {
  if (!in_array($email, $this->emails)) {
    $this->emails[] = $email;
  }
  return $this;
}