You are here

public function ActivityNotifications::markEntityAsRead in Open Social 10.0.x

Same name and namespace in other branches
  1. 8.9 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  2. 8 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  3. 8.2 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  4. 8.3 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  5. 8.4 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  6. 8.5 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  7. 8.6 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  8. 8.7 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  9. 8.8 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  10. 10.3.x modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  11. 10.1.x modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()
  12. 10.2.x modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::markEntityAsRead()

Mark an entity as read for a given account.

@todo Change

Parameters

\Drupal\Core\Session\AccountInterface $account: Account object.

\Drupal\Core\Entity\EntityBase $entity: Entity object.

Deprecated

in opensocial:8.x-7.1 and is removed from opensocial:8.x-8.0. Use \Drupal\activity_creator\ActivityNotifications ::markEntityNotificationsAsSeen() instead.

See also

to point to a change record.

https://www.drupal.org/project/social/issues/3087083

File

modules/custom/activity_creator/src/ActivityNotifications.php, line 167

Class

ActivityNotifications
Class ActivityNotifications to get Personalised activity items for account.

Namespace

Drupal\activity_creator

Code

public function markEntityAsRead(AccountInterface $account, EntityBase $entity) {

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