public function ActivityNotifications::deleteNotificationsbyIds in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::deleteNotificationsbyIds()
- 8.8 modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::deleteNotificationsbyIds()
- 10.3.x modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::deleteNotificationsbyIds()
- 10.0.x modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::deleteNotificationsbyIds()
- 10.1.x modules/custom/activity_creator/src/ActivityNotifications.php \Drupal\activity_creator\ActivityNotifications::deleteNotificationsbyIds()
Deletes all entries in activity_notification_table by given ids.
Parameters
array $activity_ids: Array of activity ids to be deleted.
Return value
bool Status of update query.
File
- modules/
custom/ activity_creator/ src/ ActivityNotifications.php, line 256
Class
- ActivityNotifications
- Class ActivityNotifications to get Personalised activity items for account.
Namespace
Drupal\activity_creatorCode
public function deleteNotificationsbyIds(array $activity_ids) : bool {
if (!empty($activity_ids)) {
// The transaction opens here.
$txn = $this->database
->startTransaction();
try {
$this->database
->delete('activity_notification_status')
->condition('aid', $activity_ids, 'IN')
->execute();
} catch (\Exception $exception) {
// Something went wrong somewhere, so roll back now.
$txn
->rollBack();
// Log the exception to watchdog.
$this
->getLogger('default')
->error($exception
->getMessage());
}
return TRUE;
}
return FALSE;
}