You are here

public function ILT::removeNotifiedMember in Opigno Instructor-led Trainings 3.x

Same name and namespace in other branches
  1. 8 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;
}