DatabaseNotificationCursor
configureQuery
Calls the provided callback to configure the underlying query for this DatabaseNotificationCursor
instance.
callback
function
true
The callback called to configure the underlying query of this DatabaseNotificationCursor
.
Return: The DatabaseNotificationCursor
instance.
fetch
Executes the configured query and stores the pagination and results internally. Maps the resulting rows into DatabaseNotification
instances.
No arguments
Return: The DatabaseNotificationCursor
instance.
hasNext
Returns true
if there are more pages left in the cursor.
No arguments
Return: boolean
next
Advances the page of the cursor and fetches the results.
No arguments
Return: The DatabaseNotificationCursor
instance.
Throws: Megaphone.DatabaseNotificationCursor.MaximumPageReached
hasPrevious
Returns true
if there are more pages before the current page in the cursor.
No arguments
Return: boolean
previous
Reverses the page of the cursor and fetches the results.
No arguments
Return: The DatabaseNotificationCursor
instance.
Throws: Megaphone.DatabaseNotificationCursor.MinimumPageReached
markAllAsRead
Marks all the notifications under the cursor as read.
This marks all the notifications the cursor applies to, not just the currently loaded page.
readDate
date
false
now()
The date to use when marking the notifications as read.
Return: The DatabaseNotificationCursor
instance.
deleteAll
Deletes all the notifications under the cursor.
This deletes all the notifications the cursor applies to, not just the currently loaded page.
Return: The DatabaseNotificationCursor
instance.
Last updated