Notification
in package
Tags
Table of Contents
Methods
- __construct() : mixed
- check() : int
- Check if the same notification exist.
- create() : mixed
- Create a notification
- delete() : mixed
- Delete a notification
Methods
__construct()
public
__construct() : mixed
check()
Check if the same notification exist.
public
static check(string $name, string $description, string $action, mixed $id_user[, mixed $must_inc = false ]) : int
Parameters
- $name : string
-
Notification's name.
- $description : string
-
Notification's description.
- $action : string
-
Notification's action.
- $id_user : mixed
- $must_inc : mixed = false
Return values
int —Indicates the number of this notification.
create()
Create a notification
public
static create(string $name, string $description[, int $level = 1 ][, string $type = '' ][, string $target = '' ][, string $action = '' ][, string $action_name = '' ][, bool $must_inc = true ][, bool $force_new = false ]) : mixed
Parameters
- $name : string
-
Notification's name
- $description : string
-
Notification's description
- $level : int = 1
-
Notification's level 1 (normal), 2 (warning), 3 (alert). Defaults to 1.
- $type : string = ''
-
Type of target to send the notification, the value of this field determine what is the parameter $target '1' user id given as target '2' group name given as target '3' all users '4' admin users '11' same as 1 but in a popup modale box '12' same as 2 but in a popup modale box '13' same as 3 but in a popup modale box '21' same as 1 but it's an hidden js call contained in action field or description field. '22' same as 2 but it's an hidden js call contained in action field or description field. '23' same as 3 but it's an hidden js call contained in action field or description field.
- $target : string = ''
-
The target that will receive the notification, may be an user id or a group name
- $action : string = ''
-
Optional. Will be applied when the notification is received. Defaults to ''.
- $action_name : string = ''
-
Optional. Complete the previous parameter. Defaults to ''.
- $must_inc : bool = true
-
Optional. Tell to increment or not the occurence of a same notification. Defaults to true.
- $force_new : bool = false
-
Optional. Force the creation of a new notification
delete()
Delete a notification
public
static delete(string $name, string $description, string $action, string $action_name) : mixed
Parameters
- $name : string
-
Notification's name
- $description : string
-
Notification's description
- $action : string
-
Notification's action
- $action_name : string
-
Notification's action_name