Arango PHP ODM

User
in package
implements EntityInterface

Represents a user in server.

Tags
author

Lucas S. Vieira

Table of Contents

Interfaces

EntityInterface
Entity interface.

Properties

$active  : bool
If user is active or not on database.
$connection  : Connection|null
Connection object to use.
$extra  : array<string|int, mixed>|null
Extra data about the user.
$isNew  : bool
If user is a new User or an existing one.
$password  : string
Password of user.
$user  : string
Name of user on server.

Methods

__construct()  : mixed
User constructor.
__debugInfo()  : array<string|int, mixed>
Proper debug dump for User objects.
__get()  : mixed|null
Get some attribute.
__toString()  : string
String representation of User object.
delete()  : bool
Removes an user from server.
getExtra()  : array<string|int, mixed>|null
Returns extra data about user.
getUsername()  : string
Returns the username.
isActive()  : bool
Get the activation status of the user.
isNew()  : bool
Returns true if is a new user.
jsonSerialize()  : array<string|int, mixed>|mixed
Return a JSON representation of list.
save()  : bool
Saves (or update) a user on server
setActive()  : void
Set the activation status of the user.
setExtra()  : void
Set extra data for user.
toArray()  : array<string|int, mixed>
Returns a array representation of user

Properties

$active

If user is active or not on database.

protected bool $active

$connection

Connection object to use.

protected Connection|null $connection

$extra

Extra data about the user.

protected array<string|int, mixed>|null $extra = null

$isNew

If user is a new User or an existing one.

protected bool $isNew

$password

Password of user.

protected string $password = ''

Used only of new users that will be created on server.

$user

Name of user on server.

protected string $user

Methods

__construct()

User constructor.

public __construct([array<string|int, mixed> $attributes = [] ][, Connection|null $connection = null ][, bool $isNew = true ]) : mixed
Parameters
$attributes : array<string|int, mixed> = []

User attributes.

$connection : Connection|null = null

Connection object to use.

$isNew : bool = true

If the user is a new one or representation of an existing user.

Tags
throws
InvalidParameterException|MissingParameterException

__debugInfo()

Proper debug dump for User objects.

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

__get()

Get some attribute.

public __get(string $name) : mixed|null
Parameters
$name : string

Attribute name.

Return values
mixed|null

Attribute value.

__toString()

String representation of User object.

public __toString() : string
Return values
string

delete()

Removes an user from server.

public delete() : bool
Tags
throws
GuzzleException|UserException
Return values
bool

True if user was removed, false otherwise (e.g. user not exists).

getExtra()

Returns extra data about user.

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

getUsername()

Returns the username.

public getUsername() : string
Return values
string

isActive()

Get the activation status of the user.

public isActive() : bool
Return values
bool

isNew()

Returns true if is a new user.

public isNew() : bool
Return values
bool

jsonSerialize()

Return a JSON representation of list.

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

save()

Saves (or update) a user on server

public save() : bool
Tags
throws
UserException
Return values
bool

True if user was created or updated on server. Throws an exception if user is duplicated.

setActive()

Set the activation status of the user.

public setActive(bool $active) : void
Parameters
$active : bool

setExtra()

Set extra data for user.

public setExtra(array<string|int, mixed> $extra) : void
Parameters
$extra : array<string|int, mixed>

toArray()

Returns a array representation of user

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

        
On this page

Search results