You are here

public function ILT::removeNotifiedMember in Opigno Instructor-led Trainings 8

Same name and namespace in other branches
  1. 3.x src/Entity/ILT.php \Drupal\opigno_ilt\Entity\ILT::removeNotifiedMember()

Removes recipient from email notification to the ILT.

Parameters

int $uid: The user ID.

Return value

$this

Overrides ILTInterface::removeNotifiedMember

File

src/Entity/ILT.php, line 302

Class

ILT
Defines the ILT entity.

Namespace

Drupal\opigno_ilt\Entity

Code

public function removeNotifiedMember($uid) {
  $values = $this
    ->get('notified_members')
    ->getValue();
  $values = array_filter($values, function ($value) use ($uid) {
    return $value['target_id'] != $uid;
  });
  $this
    ->set('notified_members', $values);
  return $this;
}