Documentación de Proyecto Sincro

usuarioWeb implements JsonSerializable

Entidad que representa a la tabla usuarioWeb del sistema Gestiona los datos del perfil y el control y verificación de contraseñas

Tags
requires

PHP 8.0 Uso de str_starts_with() y tipado de propiedades.

Table of Contents

Interfaces

JsonSerializable

Properties

$centro  : int
$cif  : int
$habilitado  : int
$id  : int|null
$nombre  : string
$password  : string|null
$tipo  : int
$usuario  : string

Methods

__construct()  : mixed
Constructor de la clase
equals()  : bool
fromArray()  : self
Constructor de usuarioWeb desde un array
getCentro()  : int
getCif()  : int
getHabilitado()  : int
getId()  : int
getNombre()  : string
getPassword()  : string
getTipo()  : int
getUsuario()  : string
hashCode()  : string
Creacion de hashCode para este objeto
hashPassword()  : string
Genera un hash bcrypt (coste 12).
jsonSerialize()  : array<string|int, mixed>
Construccion de json de la clase **NOTA** no se incluye la contraseña
setCentro()  : void
setCif()  : void
setHabilitado()  : void
setId()  : void
setNombre()  : void
setPassword()  : void
setTipo()  : void
setUsuario()  : void
validar()  : bool
Valida si el objeto se ha creado con todos los paremtros

Properties

Methods

__construct()

Constructor de la clase

public __construct(int $id, string $nombre, string $usuario, string $password, int $tipo, int $habilitado, int $centro, int $cif) : mixed
Parameters
$id : int

: id unico

$nombre : string

: nombre del usuarioWeb

$usuario : string

: usuarioWeb

$password : string

: contraseña

$tipo : int

: admin "0", usuarioWeb "1"

$habilitado : int

: 1/0, indica si esta activo

$centro : int

: centro

$cif : int

: cif del centro

equals()

public equals(mixed $obj) : bool
Parameters
$obj : mixed

: objeto a comparar

Return values
bool —

: si el objeto es de la misma clase y tienen mismo hashcode

fromArray()

Constructor de usuarioWeb desde un array

public static fromArray(array<string|int, mixed> $array) : self
Parameters
$array : array<string|int, mixed>

: datos provenientes de BD para construir al usuarioWeb

Return values
self —

nuevo usuarioWeb

getCentro()

public getCentro() : int
Return values
int

getCif()

public getCif() : int
Return values
int

getHabilitado()

public getHabilitado() : int
Return values
int

getNombre()

public getNombre() : string
Return values
string

getPassword()

public getPassword() : string
Return values
string

getTipo()

public getTipo() : int
Return values
int

getUsuario()

public getUsuario() : string
Return values
string

hashCode()

Creacion de hashCode para este objeto

public hashCode() : string
Tags
see
hash()

y sha256

Return values
string —

hashcode generado

hashPassword()

Genera un hash bcrypt (coste 12).

public static hashPassword(string $plainPassword) : string

Usar para crear usuarios o migrar contraseñas legacy.

Parameters
$plainPassword : string
Tags
see
password_hash()
Return values
string —

: Hash bcrypt

jsonSerialize()

Construccion de json de la clase **NOTA** no se incluye la contraseña

public jsonSerialize() : array<string|int, mixed>
Tags
see
JsonSerializable

Documentacion oficial de PHP

used-by

api.php/json_encode() Para el tratamiento de mensajes

Return values
array<string|int, mixed>

setCentro()

public setCentro(int $centro) : void
Parameters
$centro : int

setCif()

public setCif(int $cif) : void
Parameters
$cif : int

setHabilitado()

public setHabilitado(int $habilitado) : void
Parameters
$habilitado : int

setId()

public setId(int $id) : void
Parameters
$id : int

setNombre()

public setNombre(string $nombre) : void
Parameters
$nombre : string

setPassword()

public setPassword(string $password) : void
Parameters
$password : string

setTipo()

public setTipo(int $tipo) : void
Parameters
$tipo : int

setUsuario()

public setUsuario(string $usuario) : void
Parameters
$usuario : string

validar()

Valida si el objeto se ha creado con todos los paremtros

public validar() : bool
Return values
bool

        
On this page

Search results