public function notification_exists($thanks_data, $notification_type_name)
    {
        $notification_type_id = $this->notification_manager->get_notification_type_id($notification_type_name);
        $sql = 'SELECT notification_id FROM ' . $this->notifications_table . '
			WHERE notification_type_id = ' . (int) $notification_type_id . '
				AND item_id = ' . (int) $thanks_data['post_id'];
        $result = $this->db->sql_query($sql);
        $item_id = $this->db->sql_fetchfield('notification_id');
        $this->db->sql_freeresult($result);
        return $item_id ?: false;
    }
Example #2
0
 /**
  * Set notification manager (required)
  *
  * @param \phpbb\notification\manager $notification_manager
  */
 public function set_notification_manager(\phpbb\notification\manager $notification_manager)
 {
     $this->notification_manager = $notification_manager;
     $this->notification_type_id = $this->notification_manager->get_notification_type_id($this->get_type());
 }