You are here

public function WebformAccessGroup::removeEmail in Webform 8.5

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

Remove email address to webform access group.

Parameters

int $email: An email address.

Return value

$this

Overrides WebformAccessGroupInterface::removeEmail

File

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

Class

WebformAccessGroup
Defines the webform access group entity.

Namespace

Drupal\webform_access\Entity

Code

public function removeEmail($email) {
  foreach ($this->emails as $index => $email_address) {
    if ($email_address === $email) {
      unset($this->emails[$index]);
    }
  }
  $this->emails = array_values($this->emails);
  return $this;
}