Function Forum_driver_base->get_username

Definitions

sources/forum_stub.php

  • Get a member's username.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$id MEMBER No No required parameter N/A N/A The member
$use_displayname boolean No No False N/A N/A Whether to use the displayname rather than the username (if we have them)
$options integer No No 2 N/A N/A A bitmask of USERNAME_* options to define how to handle missing members

Returns

  • The username (null: deleted/missing member)
  • Type: ?SHORT_TEXT
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get a member's username.
 *
 * @param  MEMBER $id The member
 * @param  boolean $use_displayname Whether to use the displayname rather than the username (if we have them)
 * @param  integer $options A bitmask of USERNAME_* options to define how to handle missing members
 * @return ?SHORT_TEXT The username (null: deleted/missing member)
 */

public function get_username(int $id, bool $use_displayname = false, int $options = 2) : ?string