2022-10-11 11:20:25 +00:00
|
|
|
DELIMITER $$
|
2024-01-15 11:31:03 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`notification_send`(vNotificationName VARCHAR(255), vParams TEXT, vAuthorFk INT)
|
|
|
|
RETURNS int(11)
|
|
|
|
NOT DETERMINISTIC
|
|
|
|
MODIFIES SQL DATA
|
2022-10-11 11:20:25 +00:00
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Sends a notification.
|
|
|
|
*
|
|
|
|
* @param vNotificationName The notification name
|
|
|
|
* @param vParams The notification parameters formatted as JSON
|
|
|
|
* @param vAuthorFk The notification author or %NULL if there is no author
|
|
|
|
* @return The notification id
|
|
|
|
*/
|
|
|
|
|
|
|
|
INSERT INTO notificationQueue
|
2022-12-13 10:50:17 +00:00
|
|
|
SET notificationFk = vNotificationName,
|
2022-10-11 11:20:25 +00:00
|
|
|
params = vParams,
|
|
|
|
authorFk = vAuthorFk;
|
|
|
|
|
|
|
|
RETURN LAST_INSERT_ID();
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|