public function markEntityNotificationsAsRead(AccountInterface $account, Entity $entity) {

    // Retrieve all the activities referring this entity for this account.
    $ids = $this->getNotificationIds($account, [ACTIVITY_STATUS_RECEIVED, ACTIVITY_STATUS_SEEN], $entity);

    foreach ($ids as $activity_id) {
      $activity = Activity::load($activity_id);
      $this->changeStatusOfActivity($activity, ACTIVITY_STATUS_READ);
    }

  }
public function markEntityNotificationsAsRead(AccountInterface $account, Entity $entity) {

    // Retrieve all the activities referring this entity for this account.
    $ids = $this->getNotificationIds($account, [ACTIVITY_STATUS_RECEIVED, ACTIVITY_STATUS_SEEN], $entity);

    foreach ($ids as $activity_id) {
      $activity = Activity::load($activity_id);
      $this->changeStatusOfActivity($activity, ACTIVITY_STATUS_READ);
    }

  }
public function markEntityNotificationsAsRead ( AccountInterface $ account , Entity $ entity ) { // Retrieve all the activities referring this entity for this account. $ ids = $ this -> getNotificationIds ( $ account , [ ACTIVITY_STATUS_RECEIVED , ACTIVITY_STATUS_SEEN ] , $ entity ) ; foreach ( $ ids as $ activity_id ) { $ activity = Activity :: load ( $ activity_id ) ; $ this -> changeStatusOfActivity ( $ activity , ACTIVITY_STATUS_READ ) ; } }
Mark Notifications as Read for given account and entity..

@param \Drupal\Core\Session\AccountInterface $account
Account object.
@param \Drupal\Core\Entity\Entity $entity
Entity object.
Mark Notifications as Read for given account and entity ..