Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/04/2015 10:23:19 PM (5 years ago)
Author:
tw2113
Message:

Docs cleanup for Friends component.

See #6400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/classes/class-bp-friends-friendship.php

    r9985 r9995  
    11<?php
    22/**
    3  * BuddyPress Friends Classes
     3 * BuddyPress Friends Classes.
    44 *
    55 * @package BuddyPress
     
    7171     *
    7272     * @access public
    73      * @var unknown
     73     * @var bool
    7474     */
    7575    public $is_request;
     
    9494     * Constructor method.
    9595     *
    96      * @param int $id Optional. The ID of an existing friendship.
    97      * @param bool $is_request Deprecated.
    98      * @param bool $populate_friend_details True if friend details should
    99      *        be queried.
     96     * @param int  $id                      Optional. The ID of an existing friendship.
     97     * @param bool $is_request              Deprecated.
     98     * @param bool $populate_friend_details True if friend details should be queried.
    10099     */
    101100    public function __construct( $id = null, $is_request = false, $populate_friend_details = true ) {
     
    194193     * Get the IDs of a given user's friends.
    195194     *
    196      * @param int $user_id ID of the user whose friends are being retrieved.
     195     * @param int  $user_id              ID of the user whose friends are being retrieved.
    197196     * @param bool $friend_requests_only Optional. Whether to fetch
    198      *        unaccepted requests only. Default: false.
    199      * @param bool $assoc_arr Optional. True to receive an array of arrays
    200      *        keyed as 'user_id' => $user_id; false to get a one-dimensional
    201      *        array of user IDs. Default: false.
     197     *                                   unaccepted requests only. Default: false.
     198     * @param bool $assoc_arr            Optional. True to receive an array of arrays
     199     *                                   keyed as 'user_id' => $user_id; false to get a one-dimensional
     200     *                                   array of user IDs. Default: false.
     201     *
     202     * @return array $fids IDs of friends for provided user.
    202203     */
    203204    public static function get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) {
     
    230231     * Get the ID of the friendship object, if any, between a pair of users.
    231232     *
    232      * @param int $user_id The ID of the first user.
     233     * @param int $user_id   The ID of the first user.
    233234     * @param int $friend_id The ID of the second user.
    234      * @return int|bool The ID of the friendship object if found, otherwise
    235      *         false.
     235     *
     236     * @return int|bool The ID of the friendship object if found, otherwise false.
    236237     */
    237238    public static function get_friendship_id( $user_id, $friend_id ) {
     
    247248     *
    248249     * @param int $user_id The ID of the user who has received the
    249      *        friendship requests.
     250     *                     friendship requests.
     251     *
    250252     * @return array|bool An array of user IDs, or false if none are found.
    251253     */
     
    270272     *
    271273     * @param int $user_id Optional. ID of the user whose friendships you
    272      *        are counting. Default: displayed user (if any), otherwise
    273      *        logged-in user.
     274     *                     are counting. Default: displayed user (if any), otherwise
     275     *                     logged-in user.
     276     *
    274277     * @return int Friend count for the user.
    275278     */
     
    299302     * Search the friends of a user by a search string.
    300303     *
    301      * @param string $filter The search string, matched against xprofile
    302      *        fields (if available), or usermeta 'nickname' field.
    303      * @param int $user_id ID of the user whose friends are being searched.
    304      * @param int $limit Optional. Max number of friends to return.
    305      * @param int $page Optional. The page of results to return. Default:
    306      *        null (no pagination - return all results).
     304     * @param string $filter  The search string, matched against xprofile
     305     *                        fields (if available), or usermeta 'nickname' field.
     306     * @param int    $user_id ID of the user whose friends are being searched.
     307     * @param int    $limit   Optional. Max number of friends to return.
     308     * @param int    $page    Optional. The page of results to return. Default:
     309     *                        null (no pagination - return all results).
     310     *
    307311     * @return array|bool On success, an array: {
    308312     *     @type array $friends IDs of friends returned by the query.
    309      *     @type int $count Total number of friends (disregarding
    310      *           pagination) who match the search.
     313     *     @type int   $count  Total number of friends (disregarding
     314     *                          pagination) who match the search.
    311315     * }. Returns false on failure.
    312316     */
     
    364368     * sent the initial request)
    365369     *
    366      * @param int $initiator_userid The ID of the user who is the initiator
    367      *        of the potential friendship/request.
     370     * @param int $initiator_userid       The ID of the user who is the initiator
     371     *                                    of the potential friendship/request.
    368372     * @param int $possible_friend_userid The ID of the user who is the
    369      *        recipient of the potential friendship/request.
    370      * @return string The friendship status, from among 'not_friends',
    371      *        'is_friend', 'pending', and 'awaiting_response'.
     373     *                                    recipient of the potential friendship/request.
     374     *
     375     * @return string $value The friendship status, from among 'not_friends',
     376     *                       'is_friend', 'pending', and 'awaiting_response'.
    372377     */
    373378    public static function check_is_friend( $initiator_userid, $possible_friend_userid ) {
     
    401406     *
    402407     * @param array $user_ids IDs of users whose last_active meta is
    403      *        being queried.
    404      * @return array Array of last_active values + user_ids.
     408     *                        being queried.
     409     *
     410     * @return array $retval Array of last_active values + user_ids.
    405411     */
    406412    public static function get_bulk_last_active( $user_ids ) {
     
    434440     *
    435441     * @param int $friendship_id ID of the friendship to be accepted.
     442     *
    436443     * @return int Number of database rows updated.
    437444     */
     
    448455     *
    449456     * @param int $friendship_id ID of the friendship to be withdrawn.
     457     *
    450458     * @return int Number of database rows deleted.
    451459     */
     
    462470     *
    463471     * @param int $friendship_id ID of the friendship to be rejected.
     472     *
    464473     * @return int Number of database rows deleted.
    465474     */
     
    477486     * @todo Why does this exist, and why is it in bp-friends?
    478487     *
    479      * @param string $filter String to search by.
    480      * @param int $user_id A user ID param that is unused.
    481      * @param int $limit Optional. Max number of records to return.
    482      * @param int $page Optional. Number of the page to return. Default:
    483      *        false (no pagination - return all results).
     488     * @param string $filter  String to search by.
     489     * @param int    $user_id A user ID param that is unused.
     490     * @param int    $limit   Optional. Max number of records to return.
     491     * @param int    $page    Optional. Number of the page to return. Default:
     492     *                        false (no pagination - return all results).
     493     *
    484494     * @return array $filtered_ids IDs of users who match the query.
    485495     */
     
    521531     *
    522532     * @param string $filter Search term.
     533     *
    523534     * @return int Count of users matching the search term.
    524535     */
     
    556567     *
    557568     * @param array $user_ids Array of user IDs.
     569     *
    558570     * @return array User IDs, sorted by the associated display names.
    559571     */
     
    574586     * Get a list of random friend IDs.
    575587     *
    576      * @param int $user_id ID of the user whose friends are being retrieved.
     588     * @param int $user_id       ID of the user whose friends are being retrieved.
    577589     * @param int $total_friends Optional. Number of random friends to get.
    578      *        Default: 5.
     590     *                           Default: 5.
     591     *
    579592     * @return array|bool An array of random friend user IDs on success;
    580      *         false if none are found.
     593     *                    false if none are found.
    581594     */
    582595    public static function get_random_friends( $user_id, $total_friends = 5 ) {
     
    608621     * - users who have been banned from the group
    609622     *
    610      * @param int $user_id ID of the user whose friends are being counted.
     623     * @param int $user_id  ID of the user whose friends are being counted.
    611624     * @param int $group_id ID of the group friends are being invited to.
     625     *
    612626     * @return int $invitable_count Eligible friend count.
    613627     */
     
    643657     *
    644658     * @param int $friendship_id ID of the friendship.
     659     *
    645660     * @return object friend_user_id and initiator_user_id.
    646661     */
Note: See TracChangeset for help on using the changeset viewer.