Function Parental_controls_loader->run

Definitions

sources/cns_parental_controls.php

  • Run a parental control.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name ID_TEXT No No required parameter N/A N/A The control name to run
$age integer No No required parameter N/A N/A The age of the member for which we are checking
$region ?ID_TEXT No No Null N/A N/A The ISO code of the region in which the member is located (null: do not check on region-specific controls)
$params array No No [] N/A N/A Additional parameters to pass to the control function

Returns

  • Map of information from the control if this member is restricted (null: this member is not restricted by the given parental control)
  • Type: ?array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Run a parental control.
 *
 * @param  ID_TEXT $name The control name to run
 * @param  integer $age The age of the member for which we are checking
 * @param  ?ID_TEXT $region The ISO code of the region in which the member is located (null: do not check on region-specific controls)
 * @param  array $params Additional parameters to pass to the control function
 * @return ?array Map of information from the control if this member is restricted (null: this member is not restricted by the given parental control)
 */

public function run(string $name, int $age, ?string $region = null, array $params = []) : ?array