Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

method_interface.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 5.57 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  namespace phpbb\notification\method;
015   
016  /**
017  * Base notifications method interface
018  */
019  interface method_interface
020  {
021      /**
022      * Get notification method name
023      *
024      * @return string
025      */
026      public function get_type();
027   
028      /**
029      * Is the method enable by default?
030      *
031      * @return bool
032      */
033      public function is_enabled_by_default();
034   
035      /**
036      * Is this method available for the user?
037      * This is checked on the notifications options
038      */
039      public function is_available();
040   
041      /**
042      * Return the list of the users already notified
043      *
044      * @param int $notification_type_id ID of the notification type
045      * @param array $options
046      * @return array User
047      */
048      public function get_notified_users($notification_type_id, array $options);
049   
050      /**
051      * Load the user's notifications
052      *
053      * @param array $options Optional options to control what notifications are loaded
054      *                notification_id        Notification id to load (or array of notification ids)
055      *                user_id                User id to load notifications for (Default: $user->data['user_id'])
056      *                order_by            Order by (Default: notification_time)
057      *                order_dir            Order direction (Default: DESC)
058      *                 limit                Number of notifications to load (Default: 5)
059      *                 start                Notifications offset (Default: 0)
060      *                 all_unread            Load all unread notifications? If set to true, count_unread is set to true (Default: false)
061      *                 count_unread        Count all unread notifications? (Default: false)
062      *                 count_total            Count all notifications? (Default: false)
063      * @return array Array of information based on the request with keys:
064      *    'notifications'        array of notification type objects
065      *    'unread_count'        number of unread notifications the user has if count_unread is true in the options
066      *    'total_count'        number of notifications the user has if count_total is true in the options
067      */
068      public function load_notifications(array $options = array());
069   
070      /**
071      * Add a notification to the queue
072      *
073      * @param \phpbb\notification\type\type_interface $notification
074      */
075      public function add_to_queue(\phpbb\notification\type\type_interface $notification);
076   
077      /**
078      * Parse the queue and notify the users
079      */
080      public function notify();
081   
082      /**
083      * Update a notification
084      *
085      * @param \phpbb\notification\type\type_interface $notification Notification to update
086      * @param array $data Data specific for this type that will be updated
087      * @param array $options
088      */
089      public function update_notification($notification, array $data, array $options);
090   
091      /**
092      * Mark notifications read or unread
093      *
094      * @param bool|string $notification_type_id Type identifier of item types. False to mark read for all item types
095      * @param bool|int|array $item_id Item id or array of item ids. False to mark read for all item ids
096      * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
097      * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
098      * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)
099      */
100      public function mark_notifications($notification_type_id, $item_id, $user_id, $time = false, $mark_read = true);
101   
102      /**
103      * Mark notifications read or unread from a parent identifier
104      *
105      * @param string $notification_type_id Type identifier of item types
106      * @param bool|int|array $item_parent_id Item parent id or array of item parent ids. False to mark read for all item parent ids
107      * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
108      * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
109      * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)
110      */
111      public function mark_notifications_by_parent($notification_type_id, $item_parent_id, $user_id, $time = false, $mark_read = true);
112   
113      /**
114      * Mark notifications read or unread
115      *
116      * @param int $notification_id Notification id of notification ids.
117      * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
118      * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)
119      */
120      public function mark_notifications_by_id($notification_id, $time = false, $mark_read = true);
121   
122      /**
123      * Delete a notification
124      *
125      * @param string $notification_type_id Type identifier of item types
126      * @param int|array $item_id Identifier within the type (or array of ids)
127      * @param mixed $parent_id Parent identifier within the type (or array of ids), used in combination with item_id if specified (Default: false; not checked)
128      * @param mixed $user_id User id (Default: false; not checked)
129      */
130      public function delete_notifications($notification_type_id, $item_id, $parent_id = false, $user_id = false);
131   
132      /**
133      * Delete all notifications older than a certain time
134      *
135      * @param int $timestamp Unix timestamp to delete all notifications that were created before
136      * @param bool $only_read True (default) to only prune read notifications
137      */
138      public function prune_notifications($timestamp, $only_read = true);
139   
140      /**
141      * Purge all notifications of a certain type
142      *
143      * This should be called when an extension which has notification types
144      * is purged so that all those notifications are removed
145      *
146      * @param string $notification_type_id Type identifier of the subscription
147      */
148      public function purge_notifications($notification_type_id);
149  }
150