Documentación de Proyecto Sincro

layoutUserDao

Clase DAO para encapsular operaciones CRUD Maneja las peticiones a la tabla layoutUser

Tags
requires

PHP 8.0 Uso de tipado de propiedades.

see

conexion.php

see
PDO
see
PDOException

Table of Contents

Methods

deactivateById()  : bool
Borrado logico, activo => 0
delete()  : int
Borrado físico de BD.
getAll()  : array<string|int, LayoutUser>
Obtiene todos los layout del sistema
getAllByUser()  : array<string|int, mixed>
Obtener todos los layouts de un usuarioWeb
getByLayoutId()  : layoutUser|null
Obtener layout por su id
getByUserId()  : array<string|int, LayoutUser>
Obtener por id de usuarioWeb
getListByUserId()  : array<string|int, mixed>
Devuelve solo id + nombre de los layouts ACTIVOS del usuarioWeb.
insert()  : int
Inserta un nuevo layoutUser y devuelve el id generado.
updateNombre()  : void
Actualizar nombre del layout
__construct()  : mixed

Methods

deactivateById()

Borrado logico, activo => 0

public static deactivateById(mixed $id, mixed $user_id) : bool

Mantenido solo por si hay cambio de opinion

Parameters
$id : mixed

: id del layout

$user_id : mixed

: id del usuarioWeb

Tags
throws
Exception
Return values
bool —

: Si se ha completado o no la acción

delete()

Borrado físico de BD.

public static delete(int $id, int $user_id) : int
Parameters
$id : int

: id del layout

$user_id : int

: id del usuarioWeb

Tags
throws
Exception
Return values
int —

numero de lineas

getAll()

Obtiene todos los layout del sistema

public static getAll() : array<string|int, LayoutUser>
Tags
throws
Exception
Return values
array<string|int, LayoutUser> —

lista de layouts

getAllByUser()

Obtener todos los layouts de un usuarioWeb

public static getAllByUser(int $id_user) : array<string|int, mixed>
Parameters
$id_user : int

: id del usuarioWeb

Tags
throws
Exception
Return values
array<string|int, mixed> —

: lista de layouts del usuarioWeb

getByLayoutId()

Obtener layout por su id

public static getByLayoutId(int $layout_id) : layoutUser|null
Parameters
$layout_id : int

: id del layout

Tags
throws
Exception
Return values
layoutUser|null —

: layout buscado, null si no se encuentra

getByUserId()

Obtener por id de usuarioWeb

public static getByUserId(int $user_id) : array<string|int, LayoutUser>
Parameters
$user_id : int

: id del usuarioWeb

Tags
throws
Exception
Return values
array<string|int, LayoutUser> —

lista de layouts

getListByUserId()

Devuelve solo id + nombre de los layouts ACTIVOS del usuarioWeb.

public static getListByUserId(int $user_id) : array<string|int, mixed>
Parameters
$user_id : int

: id del usuarioWeb

Tags
throws
Exception
Return values
array<string|int, mixed> —

[ ['id' => int, 'nombre' => string], ... ]

insert()

Inserta un nuevo layoutUser y devuelve el id generado.

public static insert(int $user_id, string $nombre, int $activo) : int
Parameters
$user_id : int

: id del usuarioWeb

$nombre : string

: nombre del nuevo layout

$activo : int

: activo ( 1 / 0 )

Tags
throws
Exception
todo

cambiarlo a Objeto

Return values
int —

id del nuevo objeto generado, -1 si no se insertó

updateNombre()

Actualizar nombre del layout

public static updateNombre(int $id, int $user_id, string $nombre) : void
Parameters
$id : int

: id del layout

$user_id : int

: id del usuarioWeb

$nombre : string

: nuevo nombre del layout

Tags
throws
Exception
todo

cambiar a Object


        
On this page

Search results