Skip to:
Content

BuddyPress.org

Changeset 9993


Ignore:
Timestamp:
07/04/2015 10:17:42 PM (9 years ago)
Author:
tw2113
Message:

Docs cleanup for Notifications component.

See #6404.

Location:
trunk/src/bp-notifications
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-notifications/bp-notifications-actions.php

    r9819 r9993  
    22
    33/**
    4  * BuddyPress Notifications Actions
     4 * BuddyPress Notifications Actions.
    55 *
    66 * Action functions are exactly the same as screen functions, however they do not
  • trunk/src/bp-notifications/bp-notifications-adminbar.php

    r9819 r9993  
    1717 *
    1818 * @since BuddyPress (1.9.0)
     19 *
     20 * @return bool
    1921 */
    2022function bp_notifications_toolbar_menu() {
  • trunk/src/bp-notifications/bp-notifications-cache.php

    r9887 r9993  
    1616 * @since BuddyPress (2.3.0)
    1717 *
    18  * @param int|str|array $notification_ids Accepts a single notification_id, or a
    19  *                                        comma-separated list or array of
    20  *                                        notification ids.
     18 * @param int|string|array|bool $notification_ids Accepts a single notification_id, or a
     19 *                                                comma-separated list or array of
     20 *                                                notification ids.
    2121 */
    2222function bp_notifications_update_meta_cache( $notification_ids = false ) {
     
    3232
    3333/**
    34  * Clear all notifications cache for a given user ID
     34 * Clear all notifications cache for a given user ID.
    3535 *
    3636 * @since BuddyPress (2.3.0)
    3737 *
    38  * @param int $user_id The user ID's cache to clear
     38 * @param int $user_id The user ID's cache to clear.
    3939 */
    4040function bp_notifications_clear_all_for_user_cache( $user_id = 0 ) {
  • trunk/src/bp-notifications/bp-notifications-classes.php

    r9819 r9993  
    11<?php
    22/**
    3  * BuddyPress Notifications Classes
     3 * BuddyPress Notifications Classes.
    44 *
    55 * Classes used for the Notifications component.
  • trunk/src/bp-notifications/bp-notifications-functions.php

    r9992 r9993  
    2020 * @param array $args {
    2121 *     Array of arguments describing the notification. All are optional.
    22  *     @type int $user_id ID of the user to associate the notification with.
    23  *     @type int $item_id ID of the item to associate the notification with.
    24  *     @type int $secondary_item_id ID of the secondary item to associate the
    25  *           notification with.
    26  *     @type string $component_name Name of the component to associate the
    27  *           notification with.
    28  *     @type string $component_action Name of the action to associate the
    29  *           notification with.
    30  *     @type string $date_notified Timestamp for the notification.
     22 *     @type int    $user_id          ID of the user to associate the notification with.
     23 *     @type int    $item_id          ID of the item to associate the notification with.
     24 *     @type int    $secondary_item_id ID of the secondary item to associate the
     25 *                                     notification with.
     26 *     @type string $component_name    Name of the component to associate the
     27 *                                     notification with.
     28 *     @type string $component_action  Name of the action to associate the
     29 *                                     notification with.
     30 *     @type string $date_notified     Timestamp for the notification.
    3131 * }
    3232 * @return int|bool ID of the newly created notification on success, false
     
    8484 *
    8585 * @param int $id ID of the notification.
     86 *
    8687 * @return BP_Notifications_Notification
    8788 */
     
    9697 *
    9798 * @param int $id ID of the notification to delete.
     99 *
    98100 * @return bool True on success, false on failure.
    99101 */
     
    113115 * @since BuddyPress (1.9.0)
    114116 *
    115  * @param int $id ID of the user whose notifications are being deleted.
    116  * @param int $is_new 0 for read, 1 for unread.
     117 * @param int      $id     ID of the user whose notifications are being deleted.
     118 * @param int|bool $is_new 0 for read, 1 for unread.
     119 *
    117120 * @return bool True on success, false on failure.
    118121 */
     
    134137 *
    135138 * @param int $user_id ID of the user whose notifications are being fetched.
     139 *
    136140 * @return array
    137141 */
     
    168172 * @since BuddyPress (1.9.0)
    169173 *
    170  * @param int $user_id ID of the user whose notifications are being fetched.
    171  * @param string $format Format of the returned values. 'string' returns HTML,
    172  *        while 'object' returns a structured object for parsing.
     174 * @param int    $user_id ID of the user whose notifications are being fetched.
     175 * @param string $format  Format of the returned values. 'string' returns HTML,
     176 *                        while 'object' returns a structured object for parsing.
     177 *
    173178 * @return mixed Object or array on success, false on failure.
    174179 */
     
    313318     * @since BuddyPress (1.6.0)
    314319     *
    315      * @param Array|Bool $renderable Array of notifications to render or false if no notifications.
     320     * @param array|bool $renderable Array of notifications to render or false if no notifications.
    316321     * @param int        $user_id    ID of the user whose notifications are being displayed.
    317322     * @param string     $format     Display format requested for the notifications.
     
    330335 * @since BuddyPress (1.9.0)
    331336 *
    332  * @param int $user_id ID of the user whose notifications are being deleted.
    333  * @param string $component_name Name of the associated component.
     337 * @param int    $user_id          ID of the user whose notifications are being deleted.
     338 * @param string $component_name   Name of the associated component.
    334339 * @param string $component_action Name of the associated action.
     340 *
    335341 * @return bool True on success, false on failure.
    336342 */
     
    351357 * @since BuddyPress (1.9.0)
    352358 *
    353  * @param int $user_id ID of the user whose notifications are being deleted.
    354  * @param int $item_id ID of the associated item.
    355  * @param string $component_name Name of the associated component.
    356  * @param string $component_action Name of the associated action.
    357  * @param int $secondary_item_id ID of the secondary associated item.
     359 * @param int      $user_id           ID of the user whose notifications are being deleted.
     360 * @param int      $item_id           ID of the associated item.
     361 * @param string   $component_name    Name of the associated component.
     362 * @param string   $component_action  Name of the associated action.
     363 * @param int|bool $secondary_item_id ID of the secondary associated item.
     364 *
    358365 * @return bool True on success, false on failure.
    359366 */
     
    375382 * @since BuddyPress (1.9.0)
    376383 *
    377  * @param int $item_id ID of the user whose notifications are being deleted.
    378  * @param string $component_name Name of the associated component.
    379  * @param string $component_action Optional. Name of the associated action.
    380  * @param int $secondary_item_id Optional. ID of the secondary associated item.
     384 * @param int         $item_id           ID of the user whose notifications are being deleted.
     385 * @param string      $component_name    Name of the associated component.
     386 * @param string|bool $component_action  Optional. Name of the associated action.
     387 * @param int|bool    $secondary_item_id Optional. ID of the secondary associated item.
     388 *
    381389 * @return bool True on success, false on failure.
    382390 */
     
    401409 * @since BuddyPress (1.9.0)
    402410 *
    403  * @param int $user_id ID of the user whose associated items are being deleted.
    404  * @param string $component_name Name of the associated component.
     411 * @param int    $user_id          ID of the user whose associated items are being deleted.
     412 * @param string $component_name   Name of the associated component.
    405413 * @param string $component_action Name of the associated action.
     414 *
    406415 * @return bool True on success, false on failure.
    407416 */
     
    424433 * @since BuddyPress (1.9.0)
    425434 *
    426  * @param int $user_id ID of the user whose notifications are being deleted.
    427  * @param string $component_name Name of the associated component.
    428  * @param string $component_action Name of the associated action.
    429  * @param int $is_new 0 for read, 1 for unread.
     435 * @param int      $user_id          ID of the user whose notifications are being deleted.
     436 * @param string   $component_name   Name of the associated component.
     437 * @param string   $component_action Name of the associated action.
     438 * @param int|bool $is_new           0 for read, 1 for unread.
     439 *
    430440 * @return bool True on success, false on failure.
    431441 */
     
    451461 * @since BuddyPress (1.9.0)
    452462 *
    453  * @param int $user_id ID of the user whose notifications are being deleted.
    454  * @param int $item_id ID of the associated item.
    455  * @param string $component_name Name of the associated component.
    456  * @param string $component_action Name of the associated action.
    457  * @param int $secondary_item_id ID of the secondary associated item.
    458  * @param int $is_new 0 for read, 1 for unread.
     463 * @param int      $user_id           ID of the user whose notifications are being deleted.
     464 * @param int      $item_id           ID of the associated item.
     465 * @param string   $component_name    Name of the associated component.
     466 * @param string   $component_action  Name of the associated action.
     467 * @param int|bool $secondary_item_id ID of the secondary associated item.
     468 * @param int|bool $is_new            0 for read, 1 for unread.
     469 *
    459470 * @return bool True on success, false on failure.
    460471 */
     
    481492 * @since BuddyPress (1.9.0)
    482493 *
    483  * @param int $user_id ID of the user whose notifications are being deleted.
    484  * @param int $is_new 0 for read, 1 for unread
    485  * @param string $component_name Name of the associated component.
    486  * @param string $component_action Optional. Name of the associated action.
    487  * @param int $secondary_item_id Optional. ID of the secondary associated item.
    488  * @param int $is_new 0 for read, 1 for unread.
     494 * @param int         $item_id          ID of the user whose notifications are being deleted.
     495 * @param string      $component_name    Name of the associated component.
     496 * @param string|bool $component_action  Optional. Name of the associated action.
     497 * @param int|bool    $secondary_item_id Optional. ID of the secondary associated item.
     498 * @param int|bool    $is_new            0 for read, 1 for unread.
     499 *
    489500 * @return bool True on success, false on failure.
    490501 */
     
    514525 * @since BuddyPress (1.9.0)
    515526 *
    516  * @param int $user_id ID of the user whose associated items are being deleted.
    517  * @param int $is_new 0 for read, 1 for unread
    518  * @param string $component_name Name of the associated component.
    519  * @param string $component_action Name of the associated action.
    520  * @param int $is_new 0 for read, 1 for unread.
     527 * @param int      $user_id          ID of the user whose associated items are being deleted.
     528 * @param string   $component_name   Name of the associated component.
     529 * @param string   $component_action Name of the associated action.
     530 * @param int|bool $is_new           0 for read, 1 for unread.
     531 *
    521532 * @return bool True on success, false on failure.
    522533 */
     
    543554 * @since BuddyPress (1.9.0)
    544555 *
    545  * @param int $user_id ID of the user being checked.
     556 * @param int $user_id         ID of the user being checked.
    546557 * @param int $notification_id ID of the notification being checked.
     558 *
    547559 * @return bool True if the notification belongs to the user, otherwise false.
    548560 */
     
    557569 *
    558570 * @param int $user_id ID of the user whose unread notifications are being
    559  *        counted.
     571 *                     counted.
     572 *
    560573 * @return int Unread notification count.
    561574 */
  • trunk/src/bp-notifications/bp-notifications-loader.php

    r9936 r9993  
    1111 */
    1212
    13 // Exit if accessed directly
     13// Exit if accessed directly.
    1414defined( 'ABSPATH' ) || exit;
    1515
     
    9898     *
    9999     * @param array $main_nav Optional. See BP_Component::setup_nav() for
    100      *        description.
    101      * @param array $sub_nav Optional. See BP_Component::setup_nav() for
    102      *        description.
     100     *                        description.
     101     * @param array $sub_nav  Optional. See BP_Component::setup_nav() for
     102     *                        description.
    103103     */
    104104    public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
     
    171171     *
    172172     * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a
    173      *        description.
     173     *                            description.
    174174     */
    175175    public function setup_admin_bar( $wp_admin_nav = array() ) {
     
    246246
    247247    /**
    248      * Setup cache groups
     248     * Setup cache groups.
    249249     *
    250250     * @since BuddyPress (2.2.0)
  • trunk/src/bp-notifications/bp-notifications-template.php

    r9819 r9993  
    22
    33/**
    4  * BuddyPress Notifications Template Functions
     4 * BuddyPress Notifications Template Functions.
    55 *
    66 * @package BuddyPress
     
    206206
    207207    /**
    208      * The $_GET argument used in URLs for determining pagination
     208     * The $_GET argument used in URLs for determining pagination.
    209209     *
    210210     * @since BuddyPress (1.9.0)
     
    251251
    252252    /**
    253      * The direction to sort the results (ASC or DESC)
     253     * The direction to sort the results (ASC or DESC).
    254254     *
    255255     * @since BuddyPress (1.9.0)
     
    260260
    261261    /**
    262      * Array of variables used in this notification query
     262     * Array of variables used in this notification query.
    263263     *
    264264     * @since BuddyPress (2.2.2)
     
    434434     *
    435435     * @return bool True if there are more notifications to show,
    436      *         otherwise false.
     436     *              otherwise false.
    437437     */
    438438    public function notifications() {
     
    496496 * @since BuddyPress (1.9.0)
    497497 *
    498  * @param array $args {
     498 * @param array|string $args {
    499499 *     Arguments for limiting the contents of the notifications loop. Can be
    500500 *     passed as an associative array, or as a URL query string.
     
    503503 *     information on the arguments.  In addition, also supports:
    504504 *
    505  *     @type int $max Optional. Max items to display. Default: false.
     505 *     @type int    $max      Optional. Max items to display. Default: false.
    506506 *     @type string $page_arg URL argument to use for pagination.
    507  *           Default: 'npage'.
     507 *                            Default: 'npage'.
    508508 * }
     509 *
     510 * @return bool
    509511 */
    510512function bp_has_notifications( $args = '' ) {
     
    874876
    875877/**
    876  * Output the URL used for marking a single notification as read
     878 * Output the URL used for marking a single notification as read.
    877879 *
    878880 * Since this function directly outputs a URL, it is escaped.
     
    886888}
    887889    /**
    888      * Return the URL used for marking a single notification as read
     890     * Return the URL used for marking a single notification as read.
    889891     *
    890892     * @since BuddyPress (2.1.0)
     
    952954
    953955/**
    954  * Output the URL used for marking a single notification as unread
     956 * Output the URL used for marking a single notification as unread.
    955957 *
    956958 * Since this function directly outputs a URL, it is escaped.
     
    964966}
    965967    /**
    966      * Return the URL used for marking a single notification as unread
     968     * Return the URL used for marking a single notification as unread.
    967969     *
    968970     * @since BuddyPress (2.1.0)
     
    10631065
    10641066/**
    1065  * Output the URL used for deleting a single notification
     1067 * Output the URL used for deleting a single notification.
    10661068 *
    10671069 * Since this function directly outputs a URL, it is escaped.
     
    10761078}
    10771079    /**
    1078      * Return the URL used for deleting a single notification
     1080     * Return the URL used for deleting a single notification.
    10791081     *
    10801082     * @since BuddyPress (2.1.0)
     
    11191121 * Output the action links for the current notification.
    11201122 *
     1123 * @param array|string $args Array of arguments.
    11211124 * @since BuddyPress (1.9.0)
    11221125 */
     
    11291132     * @since BuddyPress (1.9.0)
    11301133     *
    1131      * @param array $args {
     1134     * @param array|string $args {
    11321135     *     @type string $before HTML before the links.
    1133      *     @type string $after HTML after the links.
    1134      *     @type string $sep HTML between the links.
    1135      *     @type array $links Array of links to implode by 'sep'.
     1136     *     @type string $after  HTML after the links.
     1137     *     @type string $sep    HTML between the links.
     1138     *     @type array  $links Array of links to implode by 'sep'.
    11361139     * }
    11371140     *
     
    12321235
    12331236/**
    1234  * Output the form for changing the sort order of notifications
     1237 * Output the form for changing the sort order of notifications.
    12351238 *
    12361239 * @since BuddyPress (1.9.0)
  • trunk/src/bp-notifications/classes/class-bp-notifications-notification.php

    r9887 r9993  
    11<?php
    22/**
    3  * BuddyPress Notifications Classes
     3 * BuddyPress Notifications Classes.
    44 *
    55 * Classes used for the Notifications component.
     
    103103     *
    104104     * @param int $id Optional. Provide an ID to access an existing
    105      *        notification item.
     105     *                notification item.
    106106     */
    107107    public function __construct( $id = 0 ) {
     
    145145         * @since BuddyPress (2.0.0)
    146146         *
    147          * @param BP_Notifications_Notification Current instance of the notification item being saved. Passed by reference.
     147         * @param BP_Notifications_Notification $value Current instance of the notification item being saved. Passed by reference.
    148148         */
    149149        do_action_ref_array( 'bp_notification_before_save', array( &$this ) );
     
    171171         * @since BuddyPress (2.0.0)
    172172         *
    173          * @param BP_Notifications_Notification Current instance of the notification item being saved. Passed by reference.
     173         * @param BP_Notifications_Notification $value Current instance of the notification item being saved. Passed by reference.
    174174         */
    175175        do_action_ref_array( 'bp_notification_after_save', array( &$this ) );
     
    216216     * @param array $data {
    217217     *     Array of notification data, passed to {@link wpdb::insert()}.
    218      *     @type int $user_id ID of the associated user.
    219      *     @type int $item_id ID of the associated item.
    220      *     @type int $secondary_item_id ID of the secondary associated item.
    221      *     @type string $component_name Name of the associated component.
    222      *     @type string $component_action Name of the associated component
    223      *           action.
    224      *     @type string $date_notified Timestamp of the notification.
    225      *     @type bool $is_new True if the notification is unread, otherwise
    226      *           false.
     218     *     @type int    $user_id           ID of the associated user.
     219     *     @type int    $item_id           ID of the associated item.
     220     *     @type int    $secondary_item_id ID of the secondary associated item.
     221     *     @type string $component_name    Name of the associated component.
     222     *     @type string $component_action  Name of the associated component
     223     *                                     action.
     224     *     @type string $date_notified     Timestamp of the notification.
     225     *     @type bool   $is_new            True if the notification is unread, otherwise false.
    227226     * }
    228227     * @param array $data_format See {@link wpdb::insert()}.
     
    241240     * @see wpdb::update() for further description of paramater formats.
    242241     *
    243      * @param array $data Array of notification data to update, passed to
    244      *        {@link wpdb::update()}. Accepts any property of a
    245      *        BP_Notification_Notification object.
    246      * @param array $where The WHERE params as passed to wpdb::update().
    247      *        Typically consists of array( 'ID' => $id ) to specify the ID
    248      *        of the item being updated. See {@link wpdb::update()}.
    249      * @param array $data_format See {@link wpdb::insert()}.
     242     * @param array $data         Array of notification data to update, passed to
     243     *                            {@link wpdb::update()}. Accepts any property of a
     244     *                            BP_Notification_Notification object.
     245     * @param array $where        The WHERE params as passed to wpdb::update().
     246     *                            Typically consists of array( 'ID' => $id ) to specify the ID
     247     *                            of the item being updated. See {@link wpdb::update()}.
     248     * @param array $data_format  See {@link wpdb::insert()}.
    250249     * @param array $where_format See {@link wpdb::insert()}.
     250     *
    251251     * @return int|false The number of rows updated, or false on error.
    252252     */
     
    263263     * @see wpdb::update() for further description of paramater formats.
    264264     *
    265      * @param array $where Array of WHERE clauses to filter by, passed to
    266      *        {@link wpdb::delete()}. Accepts any property of a
    267      *        BP_Notification_Notification object.
     265     * @param array $where        Array of WHERE clauses to filter by, passed to
     266     *                            {@link wpdb::delete()}. Accepts any property of a
     267     *                            BP_Notification_Notification object.
    268268     * @param array $where_format See {@link wpdb::insert()}.
     269     *
    269270     * @return int|false The number of rows updated, or false on error.
    270271     */
     
    282283     * @since BuddyPress (1.9.0)
    283284     *
    284      * @param array $args See {@link BP_Notifications_Notification::get()}
    285      *                    for more details.
     285     * @param array  $args           See {@link BP_Notifications_Notification::get()}
     286     *                               for more details.
     287     * @param string $select_sql     SQL SELECT fragment.
     288     * @param string $from_sql       SQL FROM fragment.
     289     * @param string $join_sql       SQL JOIN fragment.
     290     * @param string $meta_query_sql SQL meta query fragment.
     291     *
    286292     * @return string WHERE clause.
    287293     */
     
    404410     *
    405411     * @param array $args See {@link BP_Notifications_Notification::get()}
    406      *        for more details.
     412     *                    for more details.
     413     *
    407414     * @return string ORDER BY clause.
    408415     */
     
    441448     *
    442449     * @param array $args See {@link BP_Notifications_Notification::get()}
    443      *        for more details.
     450     *                    for more details.
     451     *
    444452     * @return string LIMIT clause.
    445453     */
     
    468476     *
    469477     * - associative arrays whose key/value pairs are column => value, to
    470      *   be used in WHERE, SET, or VALUES clauses
     478     *   be used in WHERE, SET, or VALUES clauses.
    471479     * - arrays of "formats", which tell $wpdb->prepare() which type of
    472480     *   value to expect when sanitizing (eg, array( '%s', '%d' ))
     
    497505     * @since BuddyPress (1.9.0)
    498506     *
    499      * @param $args Associative array of filter arguments.
    500      *        See {@BP_Notifications_Notification::get()} for a breakdown.
     507     * @param array $args Associative array of filter arguments.
     508     *                    See {@BP_Notifications_Notification::get()}
     509     *                    for a breakdown.
     510     *
    501511     * @return array Associative array of 'data' and 'format' args.
    502512     */
     
    559569     * @since BuddyPress (1.9.0)
    560570     *
    561      * @param int $user_id ID of the user being checked.
     571     * @param int $user_id         ID of the user being checked.
    562572     * @param int $notification_id ID of the notification being checked.
     573     *
    563574     * @return bool True if the notification belongs to the user, otherwise
    564      *         false.
     575     *              false.
    565576     */
    566577    public static function check_access( $user_id, $notification_id ) {
     
    573584
    574585    /**
    575      * Parse notifications query arguments
     586     * Parse notifications query arguments.
    576587     *
    577588     * @since BuddyPress 2.3.0
     
    609620     *     $per_page can be treated as filter values for get_where_sql()
    610621     *     and get_query_clauses(). All items are optional.
    611      *     @type int|array $id ID of notification being updated. Can be an
    612      *           array of IDs.
    613      *     @type int|array $user_id ID of user being queried. Can be an
    614      *           array of user IDs.
    615      *     @type int|array $item_id ID of associated item. Can be an array
    616      *           of multiple item IDs.
    617      *     @type int|array $secondary_item_id ID of secondary associated
    618      *           item. Can be an array of multiple IDs.
    619      *     @type string|array $component_name Name of the component to
    620      *           filter by. Can be an array of component names.
    621      *     @type string|array $component_action Name of the action to
    622      *           filter by. Can be an array of actions.
    623      *     @type bool $is_new Whether to limit to new notifications. True
    624      *           returns only new notifications, false returns only non-new
    625      *           notifications. 'both' returns all. Default: true.
    626      *     @type string $search_terms Term to match against component_name
    627      *           or component_action fields.
    628      *     @type string $order_by Database column to order notifications by.
    629      *     @type string $sort_order Either 'ASC' or 'DESC'.
    630      *     @type string $order_by Field to order results by.
    631      *     @type string $sort_order ASC or DESC.
    632      *     @type int $page Number of the current page of results. Default:
    633      *           false (no pagination - all items).
    634      *     @type int $per_page Number of items to show per page. Default:
    635      *           false (no pagination - all items).
     622     *     @type int|array    $id                ID of notification being updated. Can be an
     623     *                                           array of IDs.
     624     *     @type int|array    $user_id          ID of user being queried. Can be an
     625     *                                           array of user IDs.
     626     *     @type int|array    $item_id          ID of associated item. Can be an array
     627     *                                           of multiple item IDs.
     628     *     @type int|array    $secondary_item_id ID of secondary associated
     629     *                                           item. Can be an array of multiple IDs.
     630     *     @type string|array $component_name    Name of the component to
     631     *                                           filter by. Can be an array of component names.
     632     *     @type string|array $component_action  Name of the action to
     633     *                                           filter by. Can be an array of actions.
     634     *     @type bool         $is_new            Whether to limit to new notifications. True
     635     *                                           returns only new notifications, false returns only non-new
     636     *                                           notifications. 'both' returns all. Default: true.
     637     *     @type string       $search_terms      Term to match against component_name
     638     *                                           or component_action fields.
     639     *     @type string       $order_by          Database column to order notifications by.
     640     *     @type string       $sort_order        Either 'ASC' or 'DESC'.
     641     *     @type string       $order_by          Field to order results by.
     642     *     @type string       $sort_order        ASC or DESC.
     643     *     @type int          $page              Number of the current page of results. Default:
     644     *                                           false (no pagination - all items).
     645     *     @type int          $per_page          Number of items to show per page. Default:
     646     *                                           false (no pagination - all items).
    636647     * }
    637648     * @return array Located notifications.
     
    698709     *
    699710     * @param array $args See {@link BP_Notifications_Notification::get()}.
     711     *
    700712     * @return int Count of located items.
    701713     */
     
    754766     * @param  array $meta_query An array of meta_query filters. See the
    755767     *                           documentation for WP_Meta_Query for details.
     768     *
    756769     * @return array $sql_array 'join' and 'where' clauses.
    757770     */
     
    795808     * @param array $date_query An array of date_query parameters. See the
    796809     *                          documentation for the first parameter of WP_Date_Query.
     810     *
    797811     * @return string
    798812     */
     
    820834     *
    821835     * @param array $update_args Associative array of fields to update,
    822      *        and the values to update them to. Of the format
    823      *            array( 'user_id' => 4, 'component_name' => 'groups', )
    824      * @param array $where_args Associative array of columns/values, to
    825      *        determine which rows should be updated. Of the format
    826      *            array( 'item_id' => 7, 'component_action' => 'members', )
     836     *                           and the values to update them to. Of the format
     837     *                           array( 'user_id' => 4, 'component_name' => 'groups', )
     838     * @param array $where_args  Associative array of columns/values, to
     839     *                           determine which rows should be updated. Of the format
     840     *                           array( 'item_id' => 7, 'component_action' => 'members', )
     841     *
    827842     * @return int|bool Number of rows updated on success, false on failure.
    828843     */
     
    858873     *
    859874     * @param array $args Associative array of columns/values, to determine
    860      *        which rows should be deleted.  Of the format
    861      *            array( 'item_id' => 7, 'component_action' => 'members', )
     875     *                    which rows should be deleted.  Of the format
     876     *                    array( 'item_id' => 7, 'component_action' => 'members', )
     877     *
    862878     * @return int|bool Number of rows deleted on success, false on failure.
    863879     */
     
    890906     *
    891907     * @param int $id ID of the notification item to be deleted.
     908     *
    892909     * @return bool True on success, false on failure.
    893910     */
     
    903920     * @since BuddyPress (1.9.0)
    904921     *
    905      * @param int $user_id ID of the user whose notifications are being
    906      *        fetched.
    907      * @param string $status Optional. Status of notifications to fetch.
    908      *        'is_new' to get only unread items, 'all' to get all.
     922     * @param int    $user_id ID of the user whose notifications are being
     923     *                        fetched.
     924     * @param string $status  Optional. Status of notifications to fetch.
     925     *                        'is_new' to get only unread items, 'all' to get all.
     926     *
    909927     * @return array Associative array of notification items.
    910928     */
     
    922940     *
    923941     * @param int $user_id ID of the user whose notifications are being
    924      *        fetched.
     942     *                     fetched.
     943     *
    925944     * @return array Associative array of unread notification items.
    926945     */
     
    938957     *
    939958     * @param int $user_id ID of the user whose notifications are being
    940      *        fetched.
     959     *                     fetched.
     960     *
    941961     * @return array Associative array of unread notification items.
    942962     */
     
    955975     * @param array $args {
    956976     *     Array of arguments.
    957      *     @type int $user_id ID of the user for whom the notifications are
    958      *           being fetched. Default: logged-in user ID.
    959      *     @type bool $is_new Whether to limit the query to unread
    960      *           notifications. Default: true.
    961      *     @type int $page Number of the page to return. Default: 1.
    962      *     @type int $per_page Number of results to display per page.
    963      *           Default: 10.
     977     *     @type int    $user_id      ID of the user for whom the notifications are
     978     *                                being fetched. Default: logged-in user ID.
     979     *     @type bool   $is_new      Whether to limit the query to unread
     980     *                                notifications. Default: true.
     981     *     @type int    $page        Number of the page to return. Default: 1.
     982     *     @type int    $per_page    Number of results to display per page.
     983     *                                Default: 10.
    964984     *     @type string $search_terms Optional. A term to search against in
    965      *           the 'component_name' and 'component_action' columns.
     985     *                                the 'component_name' and 'component_action' columns.
    966986     * }
    967987     * @return array {
    968988     *     @type array $notifications Array of notification results.
    969      *     @type int $total Count of all located notifications matching
    970      *           the query params.
     989     *     @type int   $total        Count of all located notifications matching
     990     *                                the query params.
    971991     * }
    972992     */
     
    9991019     * @since BuddyPress (1.9.0)
    10001020     *
    1001      * @param int $user_id The ID of the user who the notifications
    1002      *        are for.
    1003      * @param int $is_new Mark as read (1) or unread (0).
     1021     * @param int    $user_id           The ID of the user who the notifications are for.
     1022     * @param int    $is_new            Mark as read (1) or unread (0).
     1023     * @param int    $item_id           Item ID being acted on.
     1024     * @param string $component_name    Name of component the notifications are for.
     1025     * @param string $component_action  Name of the component action.
     1026     * @param int    $secondary_item_id The ID of the secondary item.
     1027     *
     1028     * @return bool|int False on failure to update. ID on success.
    10041029     */
    10051030    public static function mark_all_for_user( $user_id, $is_new = 0, $item_id = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
     
    10391064     * @since BuddyPress (1.9.0)
    10401065     *
    1041      * @param int $user_id The ID of the user who the notifications are from.
    1042      * @param int $is_new Mark as read (1) or unread (0).
     1066     * @param int    $user_id           The ID of the user who the notifications are from.
     1067     * @param int    $is_new            Mark as read (1) or unread (0).
     1068     * @param string $component_name    Name of component the notifications are for.
     1069     * @param string $component_action  Name of the component action.
     1070     * @param int    $secondary_item_id The ID of the secondary item.
     1071     *
     1072     * @return bool|int
    10431073     */
    10441074    public static function mark_all_from_user( $user_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
     
    10751105     * @since BuddyPress (1.9.0)
    10761106     *
    1077      * @param int $item_id The ID of the item associated with the
    1078      *        notifications.
    1079      * @param string $component_name The component that the notifications
    1080      *        are associated with.
    1081      * @param string $component_action The action that the notifications
    1082      *        are associated with.
    1083      * @param string $secondary_item_id Optional. ID of the secondary
    1084      *        associated item.
     1107     * @param int    $item_id           The ID of the item associated with the
     1108     *                                  notifications.
     1109     * @param int    $is_new            Mark as read (1) or unread (0).
     1110     * @param string $component_name    The component that the notifications
     1111     *                                  are associated with.
     1112     * @param string $component_action  The action that the notifications
     1113     *                                  are associated with.
     1114     * @param int    $secondary_item_id Optional. ID of the secondary
     1115     *                                  associated item.
     1116     *
     1117     * @return bool|int
    10851118     */
    10861119    public static function mark_all_by_type( $item_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
Note: See TracChangeset for help on using the changeset viewer.