Function __global->cns_make_warning

Definitions

sources/cns_warnings2.php

  • Add a warning.Punitive actions must be added to the warning separately via systems/cns_warnings hooks.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: int

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$member_id MEMBER No No required parameter N/A N/A The member being warned
$explanation LONG_TEXT No No required parameter N/A N/A An explanation for why the member is being warned
$by ?MEMBER No No Null N/A N/A The member doing the warning (null: current member)
$time ?TIME No No Null N/A N/A The time of the warning (null: now)
$is_warning BINARY No No 1 N/A N/A Whether this counts as a formal warning

Returns

  • The ID of the new warning
  • Type: AUTO_LINK
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Add a warning.Punitive actions must be added to the warning separately via systems/cns_warnings hooks.
 *
 * @param  MEMBER $member_id The member being warned
 * @param  LONG_TEXT $explanation An explanation for why the member is being warned
 * @param  ?MEMBER $by The member doing the warning (null: current member)
 * @param  ?TIME $time The time of the warning (null: now)
 * @param  BINARY $is_warning Whether this counts as a formal warning
 * @return AUTO_LINK The ID of the new warning
 */

function cns_make_warning(int $member_id, string $explanation, ?int $by = null, ?int $time = null, int $is_warning = 1) : int