You are here

public function ActivityNotifications::changeStatusOfActivity in Open Social 8.5

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

Change the status of an activity.

Parameters

\Drupal\activity_creator\Entity\Activity $activity: Activity object.

int $status: See: activity_creator_field_activity_status_allowed_values().

Return value

\Drupal\activity_creator\Entity\Activity Returns activity object.

3 calls to ActivityNotifications::changeStatusOfActivity()
ActivityNotifications::markAllNotificationsAsSeen in modules/custom/activity_creator/src/ActivityNotifications.php
Mark all notifications as Seen for account.
ActivityNotifications::markEntityAsRead in modules/custom/activity_creator/src/ActivityNotifications.php
Mark an entity as read for a given account.
ActivityNotifications::markEntityNotificationsAsRead in modules/custom/activity_creator/src/ActivityNotifications.php
Mark Notifications as Read for given account and entity..

File

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

Class

ActivityNotifications
Class ActivityNotifications to get Personalised activity items for account.

Namespace

Drupal\activity_creator

Code

public function changeStatusOfActivity(Activity $activity, $status = ACTIVITY_STATUS_RECEIVED) {
  $activity
    ->set('field_activity_status', $status);
  return $activity
    ->save();
}