mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-18 16:18:04 +00:00
Improved noticationToDB
This commit is contained in:
@ -89,7 +89,7 @@ class Notification {
|
||||
* @return bool TRUE if the notification as an ID / FALSE else
|
||||
*/
|
||||
public function has_id() : bool {
|
||||
return $this->id != null;
|
||||
return ($this->id != null) && ($this->id != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -219,6 +219,16 @@ class Notification {
|
||||
return $this->on_elem_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the id of element targeted by the notification has been
|
||||
* specified or not
|
||||
*
|
||||
* @return bool TRUE if the ID of the target element has been specified
|
||||
*/
|
||||
public function has_on_elem_id() : bool {
|
||||
return $this->on_elem_id != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set notification target element type
|
||||
*
|
||||
@ -237,6 +247,16 @@ class Notification {
|
||||
return $this->on_elem_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the type of element targeted by the notification has been
|
||||
* specified or not
|
||||
*
|
||||
* @return bool TRUE if the ID of the target element has been specified
|
||||
*/
|
||||
public function has_on_elem_type() : bool {
|
||||
return $this->on_elem_type != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set notification event type
|
||||
*
|
||||
|
Reference in New Issue
Block a user