You are here

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

Add user id to webform access group.

Parameters

int $uid: A user id.

Return value

$this

Overrides WebformAccessGroupInterface::addUserId

File

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

Class

WebformAccessGroup
Defines the webform access group entity.

Namespace

Drupal\webform_access\Entity

Code

public function addUserId($uid) {
  if (!in_array($uid, $this->userIds)) {
    $this->userIds[] = $uid;
  }
  return $this;
}