Menu

## User
in package
implements EntityInterface

User.php : 22

Represents a user in server.

##### Tags

author

  Lucas S. Vieira

### Table of Contents

#### Interfaces

EntityInterface
  Entity interface.

#### 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

### Methods

#### __construct()

User.php : 64

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()

User.php : 88

Proper debug dump for User objects.

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

##### Return values

array<string|int, mixed>

#### __get()

User.php : 110

Get some attribute.

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

##### Parameters

$name : string

  Attribute name.

##### Return values

mixed|null —

Attribute value.

#### __toString()

User.php : 98

String representation of User object.

`public __toString() : string`

##### Return values

string

#### delete()

User.php : 228

Removes an user from server.

`public delete() : bool`

##### Tags

throws
  GuzzleException|InvalidParameterException|UserException

##### Return values

bool —

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

#### getExtra()

User.php : 164

Returns extra data about user.

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

##### Return values

array<string|int, mixed>|null

#### getUsername()

User.php : 154

Returns the username.

`public getUsername() : string`

##### Return values

string

#### isActive()

User.php : 124

Get the activation status of the user.

`public isActive() : bool`

##### Return values

bool

#### isNew()

User.php : 134

Returns true if is a new user.

`public isNew() : bool`

##### Return values

bool

#### jsonSerialize()

User.php : 257

Return a JSON representation of list.

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

##### Return values

array<string|int, mixed>|mixed

#### save()

User.php : 200

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()

User.php : 144

Set the activation status of the user.

`public setActive(bool $active) : void`

##### Parameters

$active : bool

#### setExtra()

User.php : 174

Set extra data for user.

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

##### Parameters

$extra : array<string|int, mixed>

#### toArray()

User.php : 184

Returns a array representation of user

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

##### Return values

array<string|int, mixed>

## Search results