Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/12/2015 05:45:14 AM (11 years ago)
Author:
tw2113
Message:

Further documentation cleanup for Activity Component.

See #6396.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-query.php

    r10248 r10253  
    77 */
    88
    9 // Exit if accessed directly
     9// Exit if accessed directly.
    1010defined( 'ABSPATH' ) || exit;
    1111
     
    5757         * @param array $query {
    5858         *     Array of query clauses.
    59          *
    6059         *     @type array {
    6160         *         @type string $column   Required. The column to query against. Basically, any DB column in the main
     
    8887         * @param string $alias An existing table alias that is compatible with the current query clause.
    8988         *                      Default: 'a'. BP_Activity_Activity::get() uses 'a', so we default to that.
    90          *
    9189         * @return string SQL fragment to append to the main WHERE clause.
    9290         */
     
    9896                $sql = $this->get_sql_clauses();
    9997
    100                 // we only need the 'where' clause
     98                // We only need the 'where' clause.
    10199                //
    102                 // also trim trailing "AND" clause from parent BP_Recursive_Query class
    103                 // since it's not necessary for our needs
     100                // Also trim trailing "AND" clause from parent BP_Recursive_Query class
     101                // since it's not necessary for our needs.
    104102                return preg_replace( '/^\sAND/', '', $sql['where'] );
    105103        }
     
    112110         * @param  array $clause       Array of arguments belonging to the clause.
    113111         * @param  array $parent_query Parent query to which the clause belongs.
    114          *
    115112         * @return array {
    116113         *     @type array $where Array of subclauses for the WHERE statement.
     
    138135                }
    139136
    140                 // default 'compare' to '=' if no valid operator is found
     137                // Default 'compare' to '=' if no valid operator is found.
    141138                if ( ! in_array( $clause['compare'], array(
    142139                        '=', '!=', '>', '>=', '<', '<=',
     
    156153                $where = '';
    157154
    158                 // value.
     155                // Value.
    159156                if ( isset( $clause['value'] ) ) {
    160157                        if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
     
    164161                        }
    165162
    166                         // tinyint
     163                        // Tinyint.
    167164                        if ( ! empty( $column ) && true === in_array( $column, array( 'hide_sitewide', 'is_spam' ) ) ) {
    168165                                $sql_chunks['where'][] = $wpdb->prepare( "{$alias}{$column} = %d", $value );
     
    170167                        } else {
    171168                                switch ( $compare ) {
    172                                         // IN uses different syntax
     169                                        // IN uses different syntax.
    173170                                        case 'IN' :
    174171                                        case 'NOT IN' :
     
    223220         *
    224221         * @param array $query Clause to check.
    225          *
    226222         * @return bool
    227223         */
     
    239235         *
    240236         * @param string $column The user-supplied column name.
    241          *
    242237         * @return string A validated column name value.
    243238         */
Note: See TracChangeset for help on using the changeset viewer.