Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/26/2013 06:13:51 PM (11 years ago)
Author:
boonebgorges
Message:

Explicit PHP5 visibility and static declarations for bp-groups-classes.php

See #5108, #3886

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-classes.php

    r7314 r7316  
    1212
    1313class BP_Groups_Group {
    14     var $id;
    15     var $creator_id;
    16     var $name;
    17     var $slug;
    18     var $description;
    19     var $status;
    20     var $enable_forum;
    21     var $date_created;
    22 
    23     var $admins;
    24     var $mods;
    25     var $total_member_count;
     14    public $id;
     15    public $creator_id;
     16    public $name;
     17    public $slug;
     18    public $description;
     19    public $status;
     20    public $enable_forum;
     21    public $date_created;
     22
     23    public $admins;
     24    public $mods;
     25    public $total_member_count;
    2626
    2727    /**
     
    4949    public $user_has_access;
    5050
    51     function __construct( $id = null ) {
     51    public function __construct( $id = null ) {
    5252        if ( !empty( $id ) ) {
    5353            $this->id = $id;
     
    5656    }
    5757
    58     function populate() {
     58    public function populate() {
    5959        global $wpdb, $bp;
    6060
     
    9797    }
    9898
    99     function save() {
     99    public function save() {
    100100        global $wpdb, $bp;
    101101
     
    168168    }
    169169
    170     function delete() {
     170    public function delete() {
    171171        global $wpdb, $bp;
    172172
     
    213213    }
    214214
    215     function get_invites( $user_id, $group_id ) {
     215    public static function get_invites( $user_id, $group_id ) {
    216216        global $wpdb, $bp;
    217217        return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d and is_confirmed = 0 AND inviter_id = %d", $group_id, $user_id ) );
    218218    }
    219219
    220     function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
     220    public static function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
    221221        global $wpdb, $bp;
    222222
     
    246246     * @todo Deprecate in favor of get()
    247247     */
    248     function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {
     248    public static function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {
    249249        global $wpdb, $bp;
    250250
     
    269269    }
    270270
    271     function check_slug( $slug ) {
     271    public static function check_slug( $slug ) {
    272272        global $wpdb, $bp;
    273273
     
    275275    }
    276276
    277     function get_slug( $group_id ) {
     277    public static function get_slug( $group_id ) {
    278278        global $wpdb, $bp;
    279279
     
    281281    }
    282282
    283     function has_members( $group_id ) {
     283    public static function has_members( $group_id ) {
    284284        global $wpdb, $bp;
    285285
     
    292292    }
    293293
    294     function has_membership_requests( $group_id ) {
     294    public static function has_membership_requests( $group_id ) {
    295295        global $wpdb, $bp;
    296296
     
    298298    }
    299299
    300     function get_membership_requests( $group_id, $limit = null, $page = null ) {
     300    public static function get_membership_requests( $group_id, $limit = null, $page = null ) {
    301301        global $wpdb, $bp;
    302302
     
    311311    }
    312312
    313     function get( $args = array() ) {
     313    public static function get( $args = array() ) {
    314314        global $wpdb, $bp;
    315315
     
    621621     * @return string $order_by_term
    622622     */
    623     protected function convert_orderby_to_order_by_term( $orderby ) {
     623    protected static function convert_orderby_to_order_by_term( $orderby ) {
    624624        $order_by_term = '';
    625625
     
    650650    }
    651651
    652     function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
     652    public static function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
    653653        global $wpdb, $bp, $bbdb;
    654654
     
    692692    }
    693693
    694     function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {
     694    public static function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {
    695695        global $wpdb, $bp, $bbdb;
    696696
     
    734734    }
    735735
    736     function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {
     736    public static function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {
    737737        global $wpdb, $bp;
    738738
     
    777777    }
    778778
    779     function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
     779    public static function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
    780780        global $wpdb, $bp;
    781781
     
    817817    }
    818818
    819     function get_group_extras( &$paged_groups, &$group_ids, $type = false ) {
     819    public static function get_group_extras( &$paged_groups, &$group_ids, $type = false ) {
    820820        global $bp, $wpdb;
    821821
     
    852852    }
    853853
    854     function delete_all_invites( $group_id ) {
     854    public static function delete_all_invites( $group_id ) {
    855855        global $wpdb, $bp;
    856856
     
    858858    }
    859859
    860     function get_total_group_count() {
     860    public static function get_total_group_count() {
    861861        global $wpdb, $bp;
    862862
     
    868868    }
    869869
    870     function get_global_forum_topic_count( $type ) {
     870    public static function get_global_forum_topic_count( $type ) {
    871871        global $bbdb, $wpdb, $bp;
    872872
     
    884884    }
    885885
    886     function get_total_member_count( $group_id ) {
     886    public static function get_total_member_count( $group_id ) {
    887887        global $wpdb, $bp;
    888888
     
    899899     * @return int The topic count
    900900     */
    901     function get_global_topic_count( $status = 'public', $search_terms = false ) {
     901    public static function get_global_topic_count( $status = 'public', $search_terms = false ) {
    902902        global $bbdb, $wpdb, $bp;
    903903
     
    945945     * @return array
    946946     */
    947     function get_group_type_ids() {
     947    public static function get_group_type_ids() {
    948948        global $wpdb, $bp;
    949949
     
    11951195    var $user;
    11961196
    1197     function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
     1197    public function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
    11981198
    11991199        // User and group are not empty, and ID is
     
    12171217    }
    12181218
    1219     function populate() {
     1219    public function populate() {
    12201220        global $wpdb, $bp;
    12211221
     
    12461246    }
    12471247
    1248     function save() {
     1248    public function save() {
    12491249        global $wpdb, $bp;
    12501250
     
    12901290    }
    12911291
    1292     function promote( $status = 'mod' ) {
     1292    public function promote( $status = 'mod' ) {
    12931293        if ( 'mod' == $status ) {
    12941294            $this->is_admin   = 0;
     
    13061306    }
    13071307
    1308     function demote() {
     1308    public function demote() {
    13091309        $this->is_mod     = 0;
    13101310        $this->is_admin   = 0;
     
    13141314    }
    13151315
    1316     function ban() {
     1316    public function ban() {
    13171317        if ( !empty( $this->is_admin ) )
    13181318            return false;
     
    13241324    }
    13251325
    1326     function unban() {
     1326    public function unban() {
    13271327        if ( !empty( $this->is_admin ) )
    13281328            return false;
     
    13331333    }
    13341334
    1335     function accept_invite() {
     1335    public function accept_invite() {
    13361336        $this->inviter_id    = 0;
    13371337        $this->is_confirmed  = 1;
     
    13391339    }
    13401340
    1341     function accept_request() {
     1341    public function accept_request() {
    13421342        $this->is_confirmed = 1;
    13431343        $this->date_modified = bp_core_current_time();
    13441344    }
    13451345
    1346     function remove() {
     1346    public function remove() {
    13471347        global $wpdb, $bp;
    13481348
     
    13851385    }
    13861386
    1387     function delete( $user_id, $group_id ) {
     1387    public static function delete( $user_id, $group_id ) {
    13881388        global $wpdb, $bp;
    13891389
     
    13991399    }
    14001400
    1401     function get_group_ids( $user_id, $limit = false, $page = false ) {
     1401    public static function get_group_ids( $user_id, $limit = false, $page = false ) {
    14021402        global $wpdb, $bp;
    14031403
     
    14201420    }
    14211421
    1422     function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {
     1422    public static function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {
    14231423        global $wpdb, $bp;
    14241424
     
    14421442    }
    14431443
    1444     function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {
     1444    public static function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {
    14451445        global $wpdb, $bp;
    14461446
     
    14641464    }
    14651465
    1466     function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
     1466    public static function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
    14671467        global $wpdb, $bp;
    14681468
     
    15181518    }
    15191519
    1520     function check_has_invite( $user_id, $group_id, $type = 'sent' ) {
     1520    public static function check_has_invite( $user_id, $group_id, $type = 'sent' ) {
    15211521        global $wpdb, $bp;
    15221522
     
    15321532    }
    15331533
    1534     function delete_invite( $user_id, $group_id ) {
     1534    public static function delete_invite( $user_id, $group_id ) {
    15351535        global $wpdb, $bp;
    15361536
     
    15411541    }
    15421542
    1543     function delete_request( $user_id, $group_id ) {
     1543    public static function delete_request( $user_id, $group_id ) {
    15441544        global $wpdb, $bp;
    15451545
     
    15951595     * @since BuddyPress (1.2.6)
    15961596     */
    1597     function check_is_creator( $user_id, $group_id ) {
     1597    public static function check_is_creator( $user_id, $group_id ) {
    15981598        global $bp, $wpdb;
    15991599
     
    16041604    }
    16051605
    1606     function check_for_membership_request( $user_id, $group_id ) {
     1606    public static function check_for_membership_request( $user_id, $group_id ) {
    16071607        global $wpdb, $bp;
    16081608
     
    16131613    }
    16141614
    1615     function get_random_groups( $user_id = 0, $total_groups = 5 ) {
     1615    public static function get_random_groups( $user_id = 0, $total_groups = 5 ) {
    16161616        global $wpdb, $bp;
    16171617
     
    16241624    }
    16251625
    1626     function get_group_member_ids( $group_id ) {
     1626    public static function get_group_member_ids( $group_id ) {
    16271627        global $bp, $wpdb;
    16281628
     
    16301630    }
    16311631
    1632     function get_group_administrator_ids( $group_id ) {
     1632    public static function get_group_administrator_ids( $group_id ) {
    16331633        global $bp, $wpdb;
    16341634
     
    16361636    }
    16371637
    1638     function get_group_moderator_ids( $group_id ) {
     1638    public static function get_group_moderator_ids( $group_id ) {
    16391639        global $bp, $wpdb;
    16401640
     
    16421642    }
    16431643
    1644     function get_all_membership_request_user_ids( $group_id ) {
     1644    public static function get_all_membership_request_user_ids( $group_id ) {
    16451645        global $bp, $wpdb;
    16461646
     
    16481648    }
    16491649
    1650     function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
     1650    public static function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
    16511651        global $bp, $wpdb;
    16521652
     
    17081708    }
    17091709
    1710     function delete_all( $group_id ) {
     1710    public static function delete_all( $group_id ) {
    17111711        global $wpdb, $bp;
    17121712
     
    17231723     * @uses BP_Groups_Member
    17241724     */
    1725     function delete_all_for_user( $user_id ) {
     1725    public static function delete_all_for_user( $user_id ) {
    17261726        global $bp, $wpdb;
    17271727
Note: See TracChangeset for help on using the changeset viewer.