[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/includes/common/ -> engagements.php (summary)

bbPress Common Engagements This file contains the common classes and functions for interacting with the bbPress engagements API. See `includes/users/engagements.php` for more.

File Size: 963 lines (27 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 4 classes

BBP_User_Engagements_Base:: (7 methods):
  add_user_to_object()
  remove_user_from_object()
  remove_user_from_all_objects()
  remove_object_from_all_users()
  remove_all_users_from_all_objects()
  get_users_for_object()
  get_query()

BBP_User_Engagements_Meta:: (7 methods):
  add_user_to_object()
  remove_user_from_object()
  remove_user_from_all_objects()
  remove_object_from_all_users()
  remove_all_users_from_all_objects()
  get_users_for_object()
  get_query()

BBP_User_Engagements_Term:: (8 methods):
  jit_taxonomy()
  add_user_to_object()
  remove_user_from_object()
  remove_user_from_all_objects()
  remove_object_from_all_users()
  remove_all_users_from_all_objects()
  get_users_for_object()
  get_query()

BBP_User_Engagements_User:: (13 methods):
  get_user_option_key()
  get_cache_key()
  cache_get()
  cache_set()
  cache_delete()
  parse_comma_list()
  add_user_to_object()
  remove_user_from_object()
  remove_user_from_all_objects()
  remove_object_from_all_users()
  remove_all_users_from_all_objects()
  get_users_for_object()
  get_query()

Defines 13 functions

  bbp_user_engagements_interface()

Class: BBP_User_Engagements_Base  - X-Ref

Base strategy class for interfacing with User Engagements, which other
classes will extend.

add_user_to_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post', $unique = false )   X-Ref
Add a user id to an object

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
param: bool   $unique    Whether meta key should be unique to the object
since: 2.6.0 bbPress (r6722)

remove_user_from_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove a user id from an object

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6722)

remove_user_from_all_objects( $user_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove a user id from all objects

return: bool Returns true on success, false on failure
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6722)

remove_object_from_all_users( $object_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove an object from all users

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6722)

remove_all_users_from_all_objects( $meta_key = '', $meta_type = 'post' )   X-Ref
Remove all users from all objects

return: bool Returns true on success, false on failure
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6722)

get_users_for_object( $object_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Get users of an object

return: array Returns ids of users
param: int    $object_id The object id
param: string $meta_key  The key used to index this relationship
param: string $meta_type The type of meta to look in
since: 2.6.0 bbPress (r6722)

get_query( $args = array()   X-Ref
Get the part of the query responsible for JOINing objects to relationships.

return: array
param: array  $args
param: string $meta_key
param: string $meta_type
since: 2.6.0 bbPress (r6737)

Class: BBP_User_Engagements_Meta  - X-Ref

Meta strategy for interfacing with User Engagements

add_user_to_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post', $unique = false )   X-Ref
Add a user id to an object

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
param: bool   $unique    Whether meta key should be unique to the object
since: 2.6.0 bbPress (r6722)

remove_user_from_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove a user id from an object

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6722)

remove_user_from_all_objects( $user_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove a user id from all objects

return: bool Returns true on success, false on failure
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6722)

remove_object_from_all_users( $object_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove an object from all users

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6722)

remove_all_users_from_all_objects( $meta_key = '', $meta_type = 'post' )   X-Ref
Remove all users from all objects

return: bool Returns true on success, false on failure
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6722)

get_users_for_object( $object_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Get users of an object

return: array Returns ids of users
param: int    $object_id The object id
param: string $meta_key  The key used to index this relationship
param: string $meta_type The type of meta to look in
since: 2.6.0 bbPress (r6722)

get_query( $args = array()   X-Ref
Get the part of the query responsible for JOINing objects to relationships.

return: array
param: array  $args
param: string $meta_key
param: string $meta_type
since: 2.6.0 bbPress (r6737)

Class: BBP_User_Engagements_Term  - X-Ref

Term strategy for interfacing with User Engagements

jit_taxonomy( $tax_key = '', $object_type = 'user' )   X-Ref
Register an engagement taxonomy just-in-time for immediate use

param: string $tax_key
param: string $object_type
since: 2.6.0 bbPress (r6737)

add_user_to_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post', $unique = false )   X-Ref
Add a user id to an object

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
param: bool   $unique    Whether meta key should be unique to the object
since: 2.6.0 bbPress (r6737)

remove_user_from_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove a user id from an object

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6737)

remove_user_from_all_objects( $user_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove a user id from all objects

return: bool Returns true on success, false on failure
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6737)

remove_object_from_all_users( $object_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove an object from all users

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6737)

remove_all_users_from_all_objects( $meta_key = '', $meta_type = 'post' )   X-Ref
Remove all users from all objects

return: bool Returns true on success, false on failure
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6737)

get_users_for_object( $object_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Get users of an object

return: array Returns ids of users
param: int    $object_id The object id
param: string $meta_key  The key used to index this relationship
param: string $meta_type The type of meta to look in
since: 2.6.0 bbPress (r6737)

get_query( $args = array()   X-Ref
Get the part of the query responsible for JOINing objects to relationships.

return: array
param: array  $args
param: string $meta_key
param: string $meta_type
since: 2.6.0 bbPress (r6737)

Class: BBP_User_Engagements_User  - X-Ref

User strategy for interfacing with User Engagements

This strategy largely exists for backwards compatibility with bbPress 2.5,
or installations that have not upgraded their databases to 2.6 or above.

Note: this strategy is going to be a bit less tidy than the others, because
it needs to do weird things to maintain the 2.5 status-quo. Do not use this
strategy as an example when building your own.

get_user_option_key( $meta_key = '', $object_id = 0, $prefix = false )   X-Ref
Private function to map 2.6 meta keys to 2.5 user-option keys.

return: string
param: string $meta_key
param: int    $object_id
param: bool   $prefix
since: 2.6.0 bbPress (r6844)

get_cache_key( $meta_key = '', $object_id = 0 )   X-Ref
Private function to get a 2.5 compatible cache key.

This method exists to provide backwards compatibility with bbPress 2.5,
which had caching surrounding the FIND_IN_SET usermeta queries.

return: string
param: string $meta_key
param: int    $object_id
since: 2.6.3 bbPress (r6991)

cache_get( $meta_key = '', $object_id = 0 )   X-Ref
Get the user engagement cache for a given meta key and object ID.

This method exists to provide backwards compatibility with bbPress 2.5,
which had caching surrounding the FIND_IN_SET queries in usermeta.

return: mixed Results from cache get
param: string $meta_key
param: int    $object_id
since: 2.6.3 bbPress (r6991)

cache_set( $meta_key = '', $object_id = 0, $user_ids = array()   X-Ref
Set the user engagement cache for a given meta key and object ID.

This method exists to provide backwards compatibility with bbPress 2.5,
which had caching surrounding the FIND_IN_SET queries in usermeta.

return: mixed Results from cache set
param: string $meta_key
param: int    $object_id
since: 2.6.3 bbPress (r6991)

cache_delete( $meta_key = '', $object_id = 0 )   X-Ref
Delete the user engagement cache for a given meta key and object ID.

This method exists to provide backwards compatibility with bbPress 2.5,
which had caching surrounding the FIND_IN_SET queries in usermeta.

return: mixed Results from cache delete
param: string $meta_key
param: int    $object_id
since: 2.6.3 bbPress (r6991)

parse_comma_list( $results = '' )   X-Ref
Turn a comma-separated string into an array of integers

return: array
param: string $results
since: 2.6.0 bbPress (r6844)

add_user_to_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post', $unique = false )   X-Ref
Add a user id to an object

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
param: bool   $unique    Whether meta key should be unique to the object
since: 2.6.0 bbPress (r6844)

remove_user_from_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove a user id from an object

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6844)

remove_user_from_all_objects( $user_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove a user id from all objects

return: bool Returns true on success, false on failure
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6844)

remove_object_from_all_users( $object_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Remove an object from all users

return: bool Returns true on success, false on failure
param: int    $object_id The object id
param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6844)

remove_all_users_from_all_objects( $meta_key = '', $meta_type = 'post' )   X-Ref
Remove all users from all objects

return: bool Returns true on success, false on failure
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
since: 2.6.0 bbPress (r6844)

get_users_for_object( $object_id = 0, $meta_key = '', $meta_type = 'post' )   X-Ref
Get users of an object

The database queries in this function were cached in bbPress versions
older than 2.6, but no longer are to avoid cache pollution.

return: array Returns ids of users
param: int    $object_id The object id
param: string $meta_key  The key used to index this relationship
param: string $meta_type The type of meta to look in
since: 2.6.0 bbPress (r6844)

get_query( $args = array()   X-Ref
Get the part of the query responsible for JOINing objects to relationships.

return: array
param: array  $args
param: string $meta_key
param: string $meta_type
since: 2.6.0 bbPress (r6844)

Functions
Functions that are not part of a class:

bbp_user_engagements_interface( $rel_key = '', $rel_type = 'post' )   X-Ref
Return the strategy used for storing user engagements

return: string
param: string $rel_key  The key used to index this relationship
param: string $rel_type The type of meta to look in
since: 2.6.0 bbPress (r6722)



Generated: Sat May 18 01:00:57 2024 Cross-referenced by PHPXref 0.7.1