You are here

public function WebformAccessGroup::removeUserId 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::removeUserId()

Remove user id to webform access group.

Parameters

int $uid: A user id.

Return value

$this

Overrides WebformAccessGroupInterface::removeUserId

File

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

Class

WebformAccessGroup
Defines the webform access group entity.

Namespace

Drupal\webform_access\Entity

Code

public function removeUserId($uid) {
  foreach ($this->userIds as $index => $userId) {
    if ($userId === $uid) {
      unset($this->userIds[$index]);
    }
  }
  $this->userIds = array_values($this->userIds);
  return $this;
}