[ 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

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
return: bool Returns true on success, false on failure
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

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')
return: bool Returns true on success, false on failure
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

param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
return: bool Returns true on success, false on failure
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

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')
return: bool Returns true on success, false on failure
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

param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
return: bool Returns true on success, false on failure
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

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
return: array Returns ids of users
since: 2.6.0 bbPress (r6722)

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

param: array  $args
param: string $meta_key
param: string $meta_type
return: array
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

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
return: bool Returns true on success, false on failure
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

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')
return: bool Returns true on success, false on failure
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

param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
return: bool Returns true on success, false on failure
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

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')
return: bool Returns true on success, false on failure
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

param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
return: bool Returns true on success, false on failure
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

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
return: array Returns ids of users
since: 2.6.0 bbPress (r6722)

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

param: array  $args
param: string $meta_key
param: string $meta_type
return: array
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

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
return: bool Returns true on success, false on failure
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

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')
return: bool Returns true on success, false on failure
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

param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
return: bool Returns true on success, false on failure
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

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')
return: bool Returns true on success, false on failure
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

param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
return: bool Returns true on success, false on failure
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

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
return: array Returns ids of users
since: 2.6.0 bbPress (r6737)

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

param: array  $args
param: string $meta_key
param: string $meta_type
return: array
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.

param: string $meta_key
param: int    $object_id
param: bool   $prefix
return: string
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.

param: string $meta_key
param: int    $object_id
return: string
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.

param: string $meta_key
param: int    $object_id
return: mixed Results from cache get
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.

param: string $meta_key
param: int    $object_id
return: mixed Results from cache set
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.

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

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

param: string $results
return: array
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

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
return: bool Returns true on success, false on failure
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

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')
return: bool Returns true on success, false on failure
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

param: int    $user_id   The user id
param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
return: bool Returns true on success, false on failure
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

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')
return: bool Returns true on success, false on failure
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

param: string $meta_key  The relationship key
param: string $meta_type The relationship type (usually 'post')
return: bool Returns true on success, false on failure
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.

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
return: array Returns ids of users
since: 2.6.0 bbPress (r6844)

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

param: array  $args
param: string $meta_key
param: string $meta_type
return: array
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

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



Generated: Mon Jan 27 01:01:30 2020 Cross-referenced by PHPXref 0.7.1