class Commenting (View source)

deprecated since version 2.0

Helper Class for storing the configuration options. Retains the mapping between objects which have comments attached and the related configuration options.

Also handles adding the Commenting extension to the DataObject on behalf of the user.

For documentation on how to use this class see docs/en/Configuration.md

Methods

public static 
add($class, array $settings = false) deprecated

Adds commenting to a DataObject

public static 
remove(string $class) deprecated

Removes commenting from a DataObject. Does not remove existing comments but does remove the extension.

public static 
bool
has_commenting($class) deprecated

Returns whether a given class name has commenting enabled

public static 
set_config_value(string $class, string $key, mixed $value = false) deprecated

Sets a value for a class of a given config setting. Passing 'all' as the class sets it for everything

public static 
mixed
get_config_value(string $class, string $key) deprecated

Returns a given config value for a commenting class

public static 
bool
config_value_equals(string $class, string $key, string $value) deprecated

Determines whether a config value on the commenting extension matches a given value.

public static 
bool
can_member_post(string $class) deprecated

Return whether a user can post on a given commenting instance

Details

static add($class, array $settings = false) deprecated

deprecated since version 2.0

Adds commenting to a DataObject

Parameters

$class
array $settings

Settings. See self::$default_config for available settings

Exceptions

InvalidArgumentException

static remove(string $class) deprecated

deprecated since version 2.0

Removes commenting from a DataObject. Does not remove existing comments but does remove the extension.

Parameters

string $class

Class to remove CommentsExtension from

static bool has_commenting($class) deprecated

deprecated since version 2.0

Returns whether a given class name has commenting enabled

Parameters

$class

Return Value

bool

static set_config_value(string $class, string $key, mixed $value = false) deprecated

deprecated since version 2.0

Sets a value for a class of a given config setting. Passing 'all' as the class sets it for everything

Parameters

string $class

Class to set the value on. Passing 'all' will set it to all active mappings

string $key

setting to change

mixed $value

value of the setting

static mixed get_config_value(string $class, string $key) deprecated

deprecated since version 2.0

Returns a given config value for a commenting class

Parameters

string $class
string $key

config value to return

Return Value

mixed

Exceptions

Exception

static bool config_value_equals(string $class, string $key, string $value) deprecated

deprecated since version 2.0

Determines whether a config value on the commenting extension matches a given value.

Parameters

string $class
string $key
string $value

Expected value

Return Value

bool

static bool can_member_post(string $class) deprecated

deprecated since version 2.0

Return whether a user can post on a given commenting instance

Parameters

string $class

Return Value

bool true