[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/classes/ -> class-bp-core-notification.php (summary)

Core component classes.

File Size: 317 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

BP_Core_Notification:: (9 methods):
  __construct()
  save()
  populate()
  check_access()
  get_all_for_user()
  delete_for_user_by_type()
  delete_for_user_by_item_id()
  delete_from_user_by_type()
  delete_all_by_type()


Class: BP_Core_Notification  - X-Ref

BP_Core_Notification is deprecated.

Use BP_Notifications_Notification instead.

__construct( $id = 0 )   X-Ref
Constructor

param: int $id ID for the notification.

save()   X-Ref
Update or insert notification details into the database.

return: bool Success or failure.

populate()   X-Ref
Fetches the notification data from the database.


check_access( $user_id = 0, $notification_id = 0 )   X-Ref
Check the access for a user.

return: string
param: int $user_id         ID to check access for.
param: int $notification_id Notification ID to check for.

get_all_for_user( $user_id, $status = 'is_new' )   X-Ref
Fetches all the notifications in the database for a specific user.

return: array Associative array
param: int    $user_id User ID.
param: string $status 'is_new' or 'all'.

delete_for_user_by_type( $user_id, $component_name, $component_action )   X-Ref
Delete all the notifications for a user based on the component name and action.

return: mixed
param: int    $user_id          ID of the user to delet notification for.
param: string $component_name   Component name.
param: string $component_action Component action.

delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = 0 )   X-Ref
Delete all the notifications that have a specific item id, component name and action.

return: mixed
param: int      $user_id           The ID of the user who the notifications are for.
param: int      $item_id           The item ID of the notifications we wish to delete.
param: string   $component_name    The name of the component that the notifications we wish to delete.
param: string   $component_action  The action of the component that the notifications we wish to delete.
param: int      $secondary_item_id (optional) The secondary item id of the notifications that we wish to

delete_from_user_by_type( $user_id, $component_name, $component_action )   X-Ref
Deletes all the notifications sent by a specific user, by component and action.

return: mixed
param: int    $user_id          The ID of the user whose sent notifications we wish to delete.
param: string $component_name   The name of the component the notification was sent from.
param: string $component_action The action of the component the notification was sent from.

delete_all_by_type( $item_id, $component_name, $component_action = '', $secondary_item_id = 0 )   X-Ref
Deletes all the notifications for all users by item id, and optional secondary item id,
and component name and action.

return: mixed
param: int    $item_id           The item id that they notifications are to be for.
param: string $component_name    The component that the notifications are to be from.
param: string $component_action  The action that the notifications are to be from.
param: int    $secondary_item_id Optional secondary item id that the notifications are to have.



Generated: Mon Apr 29 01:01:07 2024 Cross-referenced by PHPXref 0.7.1