Improved noticationToDB

This commit is contained in:
Pierre
2018-02-20 14:25:28 +01:00
parent ecbccd1b9d
commit 6d1c5c3d2c
2 changed files with 27 additions and 3 deletions

View File

@ -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
*