- Timestamp:
- 05/03/2015 06:51:25 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-activity-activity.php
r9819 r9833 123 123 * Constructor method. 124 124 * 125 * @param int $id Optional. The ID of a specific activity item.125 * @param int|bool $id Optional. The ID of a specific activity item. 126 126 */ 127 127 public function __construct( $id = false ) { … … 212 212 * @since BuddyPress (1.0.0) 213 213 * 214 * @param BP_Activity_Activity Current instance of the activity item being saved.214 * @param BP_Activity_Activity $this Current instance of the activity item being saved. Passed by reference. 215 215 */ 216 216 do_action_ref_array( 'bp_activity_before_save', array( &$this ) ); … … 249 249 * @since BuddyPress (1.0.0) 250 250 * 251 * @param BP_Activity_Activity Reference to current instance of activity being saved.251 * @param BP_Activity_Activity $this Current instance of activity item being saved. Passed by reference. 252 252 */ 253 253 do_action_ref_array( 'bp_activity_after_save', array( &$this ) ); … … 460 460 * 461 461 * @param array $where_conditions Current conditions for MySQL WHERE statement. 462 * @param array $r Parsed arguments passed into method.463 * @param string $select_sql Current SELECT MySQL statement at point of execution.464 * @param string $from_sql Current FROM MySQL statement at point of execution.465 * @param string $join_sql Current INNER JOIN MySQL statement at point of execution.462 * @param array $r Parsed arguments passed into method. 463 * @param string $select_sql Current SELECT MySQL statement at point of execution. 464 * @param string $from_sql Current FROM MySQL statement at point of execution. 465 * @param string $join_sql Current INNER JOIN MySQL statement at point of execution. 466 466 */ 467 467 $where_conditions = apply_filters( 'bp_activity_get_where_conditions', $where_conditions, $r, $select_sql, $from_sql, $join_sql ); … … 509 509 * @since BuddyPress (2.0.0) 510 510 * 511 * @param bool Whether to use legacy structure or not.512 * @param BP_Activity_Activity Current method being called.513 * @param array $r Parsed arguments passed into method.511 * @param bool $value Whether to use legacy structure or not. 512 * @param BP_Activity_Activity $value Current method being called. 513 * @param array $r Parsed arguments passed into method. 514 514 */ 515 515 if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $r ) ) { … … 532 532 * @since BuddyPress (1.5.0) 533 533 * 534 * @param string Concatenated MySQL statement pieces to be query results with for legacy query.534 * @param string $value Concatenated MySQL statement pieces to be query results with for legacy query. 535 535 * @param string $select_sql Final SELECT MySQL statement portion for legacy query. 536 * @param string $from_sql Final FROM MySQL statement portion for legacy query.537 * @param string $where_sql Final WHERE MySQL statement portion for legacy query.538 * @param string $sort Final sort direction for legacy query.536 * @param string $from_sql Final FROM MySQL statement portion for legacy query. 537 * @param string $where_sql Final WHERE MySQL statement portion for legacy query. 538 * @param string $sort Final sort direction for legacy query. 539 539 */ 540 540 $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) ); … … 557 557 * 558 558 * @param string $activity_ids_sql MySQL statement used to query for Activity IDs. 559 * @param array $r Array of arguments passed into method.559 * @param array $r Array of arguments passed into method. 560 560 */ 561 561 $activity_ids_sql = apply_filters( 'bp_activity_paged_activities_sql', $activity_ids_sql, $r ); … … 607 607 * @since BuddyPress (1.5.0) 608 608 * 609 * @param string MySQL statement used to query for total activities.609 * @param string $value MySQL statement used to query for total activities. 610 610 * @param string $where_sql MySQL WHERE statement portion. 611 * @param string $sort sort direction for query.611 * @param string $sort Sort direction for query. 612 612 */ 613 613 $total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(DISTINCT a.id) FROM {$bp->activity->table_name} a {$join_sql} {$where_sql}", $where_sql, $sort ); … … 632 632 * 633 633 * @param array $activity_ids Array of activity IDs. 634 * 634 635 * @return array 635 636 */ … … 696 697 * 697 698 * @param array $activities Activities array. 699 * 698 700 * @return array 699 701 */ … … 736 738 * 737 739 * @param array $activities Array of activities. 740 * 741 * @return array $activities Array of activities. 738 742 */ 739 743 protected static function prefetch_object_data( $activities ) { … … 760 764 * 761 765 * @param array $activities Array of activities. 766 * 762 767 * @return array 763 768 */ … … 787 792 * 788 793 * @param array $meta_query An array of meta_query filters. See the 789 * documentation for WP_Meta_Query for details. 794 * documentation for WP_Meta_Query for details. 795 * 790 796 * @return array $sql_array 'join' and 'where' clauses. 791 797 */ … … 827 833 * 828 834 * @param array $date_query An array of date_query parameters. See the 829 * documentation for the first parameter of WP_Date_Query. 835 * documentation for the first parameter of WP_Date_Query. 836 * 830 837 * @return string 831 838 */ … … 855 862 * @param array $r Current activity arguments. Same as those of BP_Activity_Activity::get(), 856 863 * but merged with defaults. 864 * 857 865 * @return array 'sql' WHERE SQL string and 'override' activity args 858 866 */ … … 956 964 * @deprecated Use BP_Activity_Activity::get() with an 'in' parameter instead. 957 965 * 958 * @param mixed $activity_idsArray or comma-separated string of activity IDs to retrieve959 * @param int $maxMaximum number of results to return. (Optional; default is no maximum)960 * @param int $pageThe set of results that the user is viewing. Used in pagination. (Optional; default is 1)961 * @param int $per_pageSpecifies how many results per page. Used in pagination. (Optional; default is 25)962 * @param string MySQL column sort; ASC or DESC. (Optional; default is DESC)963 * @param bool $display_comments Retrieve an activity item's associated comments or not. (Optional; default is false)966 * @param mixed $activity_ids Array or comma-separated string of activity IDs to retrieve 967 * @param int|bool $max Maximum number of results to return. (Optional; default is no maximum) 968 * @param int $page The set of results that the user is viewing. Used in pagination. (Optional; default is 1) 969 * @param int $per_page Specifies how many results per page. Used in pagination. (Optional; default is 25) 970 * @param string $sort MySQL column sort; ASC or DESC. (Optional; default is DESC) 971 * @param bool $display_comments Retrieve an activity item's associated comments or not. (Optional; default is false) 964 972 * @return array 965 973 */ … … 1041 1049 * 1042 1050 * @param array $args { 1043 * @int $idOptional. The ID of a specific item to delete.1044 * @string $action Optional. The action to filter by.1045 * @string $content Optional. The content to filter by.1046 * @string $component Optional. The component name to filter by.1047 * @string $type Optional. The activity type to filter by.1048 * @string $primary_link Optional. The primary URL to filter by.1049 * @int $user_idOptional. The user ID to filter by.1050 * @int $item_idOptional. The associated item ID to filter by.1051 * @int $secondary_item_id Optional. The secondary associated item ID to filter by.1052 * @string $date_recorded Optional. The date to filter by.1053 * @int $hide_sitewideOptional. Default: false.1051 * @int $id Optional. The ID of a specific item to delete. 1052 * @string $action Optional. The action to filter by. 1053 * @string $content Optional. The content to filter by. 1054 * @string $component Optional. The component name to filter by. 1055 * @string $type Optional. The activity type to filter by. 1056 * @string $primary_link Optional. The primary URL to filter by. 1057 * @int $user_id Optional. The user ID to filter by. 1058 * @int $item_id Optional. The associated item ID to filter by. 1059 * @int $secondary_item_id Optional. The secondary associated item ID to filter by. 1060 * @string $date_recorded Optional. The date to filter by. 1061 * @int $hide_sitewide Optional. Default: false. 1054 1062 * } 1063 * 1055 1064 * @return array|bool An array of deleted activity IDs on success, false on failure. 1056 1065 */ … … 1216 1225 * 1217 1226 * @param array $activity_ids Activity IDs whose comments should be deleted. 1218 * @param bool $delete_meta Should we delete the activity meta items for these comments? 1227 * @param bool $delete_meta Should we delete the activity meta items for these comments? 1228 * 1219 1229 * @return bool True on success. 1220 1230 */ … … 1245 1255 * 1246 1256 * @param array $activity_ids Activity IDs whose meta should be deleted. 1257 * 1247 1258 * @return bool True on success. 1248 1259 */ … … 1264 1275 * @global wpdb $wpdb WordPress database object 1265 1276 * 1266 * @param array $activities Activities to fetch comments for. 1267 * @param bool $spam Optional. 'ham_only' (default), 'spam_only' or 'all'. 1277 * @param array $activities Activities to fetch comments for. 1278 * @param string $spam Optional. 'ham_only' (default), 'spam_only' or 'all'. 1279 * 1268 1280 * @return array The updated activities with nested comments. 1269 1281 */ … … 1294 1306 * @global wpdb $wpdb WordPress database object. 1295 1307 * 1296 * @param int $activity_id Activity ID to fetch comments for. 1297 * @param int $left Left-most node boundary. 1298 * @param into $right Right-most node boundary. 1299 * @param bool $spam Optional. 'ham_only' (default), 'spam_only' or 'all'. 1300 * @param int $top_level_parent_id Optional. The id of the root-level parent activity item. 1308 * @param int $activity_id Activity ID to fetch comments for. 1309 * @param int $left Left-most node boundary. 1310 * @param int $right Right-most node boundary. 1311 * @param string $spam Optional. 'ham_only' (default), 'spam_only' or 'all'. 1312 * @param int $top_level_parent_id Optional. The id of the root-level parent activity item. 1313 * 1301 1314 * @return array The updated activities with nested comments. 1302 1315 */ … … 1348 1361 * @since BuddyPress (2.0.0) 1349 1362 * 1350 * @param bool Whether or not to use the legacy query.1351 * @param BP_Activity_Activity Magic method referring to currently called method.1352 * @param array $func_argsArray of the method's argument list.1363 * @param bool $value Whether or not to use the legacy query. 1364 * @param BP_Activity_Activity $value Magic method referring to currently called method. 1365 * @param array $func_args Array of the method's argument list. 1353 1366 */ 1354 1367 if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $func_args ) ) { … … 1359 1372 * @since BuddyPress (1.5.0) 1360 1373 * 1361 * @param string Prepared statement for the activity query.1374 * @param string $value Prepared statement for the activity query. 1362 1375 * @param int $activity_id Activity ID to fetch comments for. 1363 * @param int $left Left-most node boundary.1364 * @param int $right Right-most node boundary.1365 * @param string $spam_sql SQL Statement portion to differentiate between ham or spam.1376 * @param int $left Left-most node boundary. 1377 * @param int $right Right-most node boundary. 1378 * @param string $spam_sql SQL Statement portion to differentiate between ham or spam. 1366 1379 */ 1367 1380 $sql = apply_filters( 'bp_activity_comments_user_join_filter', $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' {$spam_sql} AND a.item_id = %d AND a.mptt_left > %d AND a.mptt_left < %d ORDER BY a.date_recorded ASC", $top_level_parent_id, $left, $right ), $activity_id, $left, $right, $spam_sql ); … … 1489 1502 * 1490 1503 * @param int $parent_id ID of an activity or activity comment. 1504 * 1491 1505 * @return object Numerically indexed array of child comments. 1492 1506 */ … … 1507 1521 * the activity table, but these items are not full-fledged 1508 1522 * activity items.) Default: true. 1523 * 1509 1524 * @return array List of component names. 1510 1525 */ … … 1527 1542 * 1528 1543 * @param int $limit Optional. Number of items to fetch. Default: 35. 1544 * 1529 1545 * @return array $activity_feed List of activity items, with RSS data added. 1530 1546 */ … … 1551 1567 * @see BP_Activity_Activity::get_filter_sql() 1552 1568 * 1553 * @param string $field The database field.1569 * @param string $field The database field. 1554 1570 * @param array|bool $items The values for the IN clause, or false when none are found. 1571 * 1572 * @return string|bool. 1555 1573 */ 1556 1574 public static function get_in_operator_sql( $field, $items ) { … … 1587 1605 * @param array $filter_array { 1588 1606 * Fields and values to filter by. 1589 * @type array|string|id $user_id User ID(s). 1590 * @type array|string $object Corresponds to the 'component' 1591 * column in the database. 1592 * @type array|string $action Corresponds to the 'type' column 1593 * in the database. 1594 * @type array|string|int $primary_id Corresponds to the 'item_id' 1595 * column in the database. 1607 * 1608 * @type array|string|int $user_id User ID(s). 1609 * @type array|string $object Corresponds to the 'component' 1610 * column in the database. 1611 * @type array|string $action Corresponds to the 'type' column 1612 * in the database. 1613 * @type array|string|int $primary_id Corresponds to the 'item_id' 1614 * column in the database. 1596 1615 * @type array|string|int $secondary_id Corresponds to the 1597 * 'secondary_item_id' column in the database.1598 * @type int $offsetReturn only those items with an ID greater1599 * than the offset value.1600 * @type string $sinceReturn only those items that have a1601 * date_recorded value greater than a given MySQL-formatted1602 * date.1616 * 'secondary_item_id' column in the database. 1617 * @type int $offset Return only those items with an ID greater 1618 * than the offset value. 1619 * @type string $since Return only those items that have a 1620 * date_recorded value greater than a 1621 * given MySQL-formatted date. 1603 1622 * } 1623 * 1604 1624 * @return string The filter clause, for use in a SQL query. 1605 1625 */ … … 1678 1698 * @since BuddyPress (1.2.0) 1679 1699 * 1680 * @param int The ID of the user whose favorites you're counting. 1681 * @return int A count of the user's favorites. 1700 * @param int $user_id The ID of the user whose favorites you're counting. 1701 * 1702 * @return int $value A count of the user's favorites. 1682 1703 */ 1683 1704 public static function total_favorite_count( $user_id ) { … … 1697 1718 * 1698 1719 * @param string $content The content to filter by. 1720 * 1699 1721 * @return int|bool The ID of the first matching item if found, otherwise false. 1700 1722 */ … … 1711 1733 * 1712 1734 * @param int $user_id The ID of the user whose activity you want to mark hidden. 1713 * @param int 1735 * 1736 * @return mixed 1714 1737 */ 1715 1738 public static function hide_all_for_user( $user_id ) { … … 1739 1762 * @param array $base Array with keys needing to be replaced 1740 1763 * @param array $replacements Array with the replaced keys 1764 * 1741 1765 * @return array 1742 1766 */
Note: See TracChangeset
for help on using the changeset viewer.