Function Hook_privacy_catalogues->anonymise

Definitions

sources/hooks/systems/privacy/catalogues.php

  • Anonymise a row.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$table_name ID_TEXT No No required parameter N/A N/A Table name
$table_details array No No required parameter N/A N/A Details of the table from the info function
$row array No No required parameter N/A N/A Row raw from the database
$username ID_TEXT No No Blank (empty string) N/A N/A Only anonymise username fields containing this username (blank: do not filter by this)
$ip_addresses array No No [] N/A N/A Only anonymise IP fields containing one of these IP addresses (empty: do not filter by this)
$member_id ?MEMBER No No Null N/A N/A Only anonymise member fields containing this member ID (null: do not filter by this)
$email_address string No No Blank (empty string) N/A N/A Only anonymise e-mail fields containing this e-mail address (blank: do not filter by this)
$others array No No [] N/A N/A Only anonymise additional fields containing one of these strings (empty: do not filter by this)
$reverse_logic_return boolean No No False N/A N/A Whether to anonymise on fields that do not match the provided criteria instead of those that do, and return a modified $row instead of modifying the database

Returns

  • Modified row, if $reverse_logic_return was true (null: $reverse_logic_return was false)
  • Type: ?array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Anonymise a row.
 *
 * @param  ID_TEXT $table_name Table name
 * @param  array $table_details Details of the table from the info function
 * @param  array $row Row raw from the database
 * @param  ID_TEXT $username Only anonymise username fields containing this username (blank: do not filter by this)
 * @param  array $ip_addresses Only anonymise IP fields containing one of these IP addresses (empty: do not filter by this)
 * @param  ?MEMBER $member_id Only anonymise member fields containing this member ID (null: do not filter by this)
 * @param  string $email_address Only anonymise e-mail fields containing this e-mail address (blank: do not filter by this)
 * @param  array $others Only anonymise additional fields containing one of these strings (empty: do not filter by this)
 * @param  boolean $reverse_logic_return Whether to anonymise on fields that do not match the provided criteria instead of those that do, and return a modified $row instead of modifying the database
 * @return ?array Modified row, if $reverse_logic_return was true (null: $reverse_logic_return was false)
 */

public function anonymise(string $table_name, array $table_details, array $row, string $username = '', array $ip_addresses = [], ?int $member_id = null, string $email_address = '', array $others = [], bool $reverse_logic_return = false) : ?array