You are here

public function Workspace::addMember in Opigno Moxtra 3.x

Same name and namespace in other branches
  1. 8 src/Entity/Workspace.php \Drupal\opigno_moxtra\Entity\Workspace::addMember()

Adds member to the workspace.

Parameters

int $uid: The user ID.

Return value

$this

Overrides WorkspaceInterface::addMember

File

src/Entity/Workspace.php, line 145

Class

Workspace
Defines the Workspace entity.

Namespace

Drupal\opigno_moxtra\Entity

Code

public function addMember($uid) {
  $this
    ->get('members')
    ->appendItem([
    'target_id' => $uid,
  ]);
  return $this;
}