- Timestamp:
- 07/04/2015 10:23:19 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/classes/class-bp-friends-friendship.php
r9985 r9995 1 1 <?php 2 2 /** 3 * BuddyPress Friends Classes 3 * BuddyPress Friends Classes. 4 4 * 5 5 * @package BuddyPress … … 71 71 * 72 72 * @access public 73 * @var unknown73 * @var bool 74 74 */ 75 75 public $is_request; … … 94 94 * Constructor method. 95 95 * 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. 100 99 */ 101 100 public function __construct( $id = null, $is_request = false, $populate_friend_details = true ) { … … 194 193 * Get the IDs of a given user's friends. 195 194 * 196 * @param int $user_idID of the user whose friends are being retrieved.195 * @param int $user_id ID of the user whose friends are being retrieved. 197 196 * @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. 202 203 */ 203 204 public static function get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) { … … 230 231 * Get the ID of the friendship object, if any, between a pair of users. 231 232 * 232 * @param int $user_id The ID of the first user.233 * @param int $user_id The ID of the first user. 233 234 * @param int $friend_id The ID of the second user. 234 * @return int|bool The ID of the friendship object if found, otherwise235 * 235 * 236 * @return int|bool The ID of the friendship object if found, otherwise false. 236 237 */ 237 238 public static function get_friendship_id( $user_id, $friend_id ) { … … 247 248 * 248 249 * @param int $user_id The ID of the user who has received the 249 * friendship requests. 250 * friendship requests. 251 * 250 252 * @return array|bool An array of user IDs, or false if none are found. 251 253 */ … … 270 272 * 271 273 * @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 * 274 277 * @return int Friend count for the user. 275 278 */ … … 299 302 * Search the friends of a user by a search string. 300 303 * 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 * 307 311 * @return array|bool On success, an array: { 308 312 * @type array $friends IDs of friends returned by the query. 309 * @type int $countTotal number of friends (disregarding310 * pagination) who match the search.313 * @type int $count Total number of friends (disregarding 314 * pagination) who match the search. 311 315 * }. Returns false on failure. 312 316 */ … … 364 368 * sent the initial request) 365 369 * 366 * @param int $initiator_userid The ID of the user who is the initiator367 * 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. 368 372 * @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'. 372 377 */ 373 378 public static function check_is_friend( $initiator_userid, $possible_friend_userid ) { … … 401 406 * 402 407 * @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. 405 411 */ 406 412 public static function get_bulk_last_active( $user_ids ) { … … 434 440 * 435 441 * @param int $friendship_id ID of the friendship to be accepted. 442 * 436 443 * @return int Number of database rows updated. 437 444 */ … … 448 455 * 449 456 * @param int $friendship_id ID of the friendship to be withdrawn. 457 * 450 458 * @return int Number of database rows deleted. 451 459 */ … … 462 470 * 463 471 * @param int $friendship_id ID of the friendship to be rejected. 472 * 464 473 * @return int Number of database rows deleted. 465 474 */ … … 477 486 * @todo Why does this exist, and why is it in bp-friends? 478 487 * 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 * 484 494 * @return array $filtered_ids IDs of users who match the query. 485 495 */ … … 521 531 * 522 532 * @param string $filter Search term. 533 * 523 534 * @return int Count of users matching the search term. 524 535 */ … … 556 567 * 557 568 * @param array $user_ids Array of user IDs. 569 * 558 570 * @return array User IDs, sorted by the associated display names. 559 571 */ … … 574 586 * Get a list of random friend IDs. 575 587 * 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. 577 589 * @param int $total_friends Optional. Number of random friends to get. 578 * Default: 5. 590 * Default: 5. 591 * 579 592 * @return array|bool An array of random friend user IDs on success; 580 * false if none are found.593 * false if none are found. 581 594 */ 582 595 public static function get_random_friends( $user_id, $total_friends = 5 ) { … … 608 621 * - users who have been banned from the group 609 622 * 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. 611 624 * @param int $group_id ID of the group friends are being invited to. 625 * 612 626 * @return int $invitable_count Eligible friend count. 613 627 */ … … 643 657 * 644 658 * @param int $friendship_id ID of the friendship. 659 * 645 660 * @return object friend_user_id and initiator_user_id. 646 661 */
Note: See TracChangeset
for help on using the changeset viewer.