MIDDAG for Moodle

user_support extends facade

Facade for local_middag\framework\support\moodle\user_support.

Tags
see
user_support
mixin

Table of Contents

Methods

create_user()  : int
delete_user()  : bool
fullname()  : string
get_all_profile_fields()  : array<string|int, mixed>
get_current()  : user|null
get_current_user_id()  : int
get_facade_accessor()  : string
Return the service accessor key for this facade.
get_field_by_user()  : mixed
get_options_for_user_fields()  : array<string|int, mixed>
get_user()  : user|null
get_user_by_email()  : user|null
get_user_by_username()  : user|null
get_user_field()  : stdClass|false|null
get_user_field_data_by_shortname()  : stdClass|int|false|null
save_profile_fields()  : void
update_user()  : void

Methods

create_user()

public static create_user(stdClass $userobj[, bool $updatepassword = = 'false' ][, bool $nologin = = 'false' ]) : int
Parameters
$userobj : stdClass
$updatepassword : bool = = 'false'
$nologin : bool = = 'false'
Return values
int

delete_user()

public static delete_user(stdClass $user) : bool
Parameters
$user : stdClass
Return values
bool

fullname()

public static fullname(stdClass|user $user) : string
Parameters
$user : stdClass|user
Return values
string

get_all_profile_fields()

public static get_all_profile_fields() : array<string|int, mixed>
Return values
array<string|int, mixed>

get_current_user_id()

public static get_current_user_id() : int
Return values
int

get_facade_accessor()

Return the service accessor key for this facade.

public static get_facade_accessor() : string
Return values
string

get_field_by_user()

public static get_field_by_user(string|int $fieldidorshortname[, int|null $userid = = 'null' ]) : mixed
Parameters
$fieldidorshortname : string|int
$userid : int|null = = 'null'

get_options_for_user_fields()

public static get_options_for_user_fields([bool $includeemailfield = = 'false' ]) : array<string|int, mixed>
Parameters
$includeemailfield : bool = = 'false'
Return values
array<string|int, mixed>

get_user()

public static get_user(int $userid[, string $fields = = '\'*\'' ][, int $strictness = = 'IGNORE_MISSING' ]) : user|null
Parameters
$userid : int
$fields : string = = '\'*\''
$strictness : int = = 'IGNORE_MISSING'
Return values
user|null

get_user_by_email()

public static get_user_by_email(string $email[, string $fields = = '\'*\'' ][, int|null $mnethostid = = 'null' ][, int $strictness = = 'IGNORE_MISSING' ]) : user|null
Parameters
$email : string
$fields : string = = '\'*\''
$mnethostid : int|null = = 'null'
$strictness : int = = 'IGNORE_MISSING'
Return values
user|null

get_user_by_username()

public static get_user_by_username(string $username[, int|null $mnethostid = = 'null' ][, int $strictness = = 'IGNORE_MISSING' ]) : user|null
Parameters
$username : string
$mnethostid : int|null = = 'null'
$strictness : int = = 'IGNORE_MISSING'
Return values
user|null

get_user_field()

public static get_user_field(int $fieldid[, int|null $userid = = 'null' ]) : stdClass|false|null
Parameters
$fieldid : int
$userid : int|null = = 'null'
Return values
stdClass|false|null

get_user_field_data_by_shortname()

public static get_user_field_data_by_shortname(string $shortname[, int|null $userid = = 'null' ]) : stdClass|int|false|null
Parameters
$shortname : string
$userid : int|null = = 'null'
Return values
stdClass|int|false|null

save_profile_fields()

public static save_profile_fields(int $userid, string|int $fieldidorshortname, string $value) : void
Parameters
$userid : int
$fieldidorshortname : string|int
$value : string

update_user()

public static update_user(stdClass $userobj[, bool $updatepassword = = 'true' ][, bool $triggerevent = = 'true' ]) : void
Parameters
$userobj : stdClass
$updatepassword : bool = = 'true'
$triggerevent : bool = = 'true'

        
On this page

Search results