RavSystem API docs

User extends Model
in package

Table of Contents

$access  : Access|null
$accessId  : int
$activated  : bool
$blocked  : bool
$created  : JsonDateTime
$deleted  : bool
$email  : string
$id  : int
$image  : Image
$imageId  : int
$lastActivity  : JsonDateTime
$lastGeneratedKeyDate  : JsonDateTime
$loginFails  : int
$metadata  : stdClass
$name  : string
$password  : string
$surname  : string
$uniqueKey  : string|null
$updated  : JsonDateTime
$metadataShouldBeLoaded  : bool
__construct()  : mixed
__set()  : mixed
activate()  : void
Activates the user if provided key is correct
assignUniqueKey()  : void
Assigns unique key to the user
generateUniqueKey()  : string
generates unique key
isSessionUser()  : bool
Checks if user is the user who performing request
jsonSerialize()  : array<string|int, mixed>
Specify data which should be serialized to JSON
loadMetadata()  : void
Triggers loading metadata to User JSON representation
login()  : void
Login the user.
unblock()  : void
Unblock the user if provided key is correct
update()  : void
Updates model properties with form data
validate()  : void
Domain object save validation callback.
assertUniqueKeyIsCorrect()  : void
Asserts that the key provided by user is correct

Properties

$accessId

public int $accessId

$activated

public bool $activated

$blocked

public bool $blocked

$deleted

public bool $deleted

$email

public string $email

$imageId

public int $imageId

$loginFails

public int $loginFails

$metadata

public stdClass $metadata

$name

public string $name

$password

public string $password

$surname

public string $surname

$uniqueKey

public string|null $uniqueKey

$metadataShouldBeLoaded

private bool $metadataShouldBeLoaded = FALSE

Methods

__construct()

public __construct(int $id, string $name, string $surname, string $email, string $password, bool $activated, int $loginFails, bool $blocked, bool $deleted, string|null $uniqueKey, JsonDateTime $lastGeneratedKeyDate, Access|null $access, Image $image, stdClass $metadata, JsonDateTime $lastActivity, JsonDateTime $created, JsonDateTime $updated, int $imageId, int $accessId) : mixed
Parameters
$id : int
$name : string
$surname : string
$email : string
$password : string
$activated : bool
$loginFails : int
$blocked : bool
$deleted : bool
$uniqueKey : string|null
$lastGeneratedKeyDate : JsonDateTime
$access : Access|null
$image : Image
$metadata : stdClass
$lastActivity : JsonDateTime
$created : JsonDateTime
$updated : JsonDateTime
$imageId : int
$accessId : int
Return values
mixed

activate()

Activates the user if provided key is correct

public activate(string $userKey) : void
Parameters
$userKey : string
Return values
void

assignUniqueKey()

Assigns unique key to the user

public assignUniqueKey() : void
Return values
void

generateUniqueKey()

generates unique key

public static generateUniqueKey([int $length = 6 ]) : string
Parameters
$length : int = 6
Return values
string

isSessionUser()

Checks if user is the user who performing request

public isSessionUser(stdClass $session) : bool
Parameters
$session : stdClass
Return values
bool

jsonSerialize()

Specify data which should be serialized to JSON

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

loadMetadata()

Triggers loading metadata to User JSON representation

public loadMetadata() : void
Return values
void

unblock()

Unblock the user if provided key is correct

public unblock(string $userKey) : void
Parameters
$userKey : string
Return values
void

update()

Updates model properties with form data

public update(stdClass $form) : void
Parameters
$form : stdClass
Return values
void

assertUniqueKeyIsCorrect()

Asserts that the key provided by user is correct

private assertUniqueKeyIsCorrect(string $userKey) : void
Parameters
$userKey : string
Tags
throws
InvalidUserCodeException
Return values
void

Search results