mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
empezada la estructura de tickets
This commit is contained in:
52
ci4/app/Entities/Soporte/TicketEntity.php
Normal file
52
ci4/app/Entities/Soporte/TicketEntity.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Soporte;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class TicketEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
'id' => null,
|
||||
'usuario_id' => null,
|
||||
'tecnico_id' => null,
|
||||
'categoria_id'=> null,
|
||||
'estado_id' => null,
|
||||
'prioridad' => 'media',
|
||||
'titulo' => '',
|
||||
'descripcion' => '',
|
||||
'created_at' => null,
|
||||
'updated_at' => null,
|
||||
];
|
||||
|
||||
protected $dates = ['created_at', 'updated_at'];
|
||||
|
||||
public function setTitulo(string $titulo)
|
||||
{
|
||||
$this->attributes['titulo'] = ucfirst($titulo); // Capitaliza el título
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDescripcion(string $descripcion)
|
||||
{
|
||||
$this->attributes['descripcion'] = ucfirst($descripcion);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPrioridad(): string
|
||||
{
|
||||
return ucfirst($this->attributes['prioridad']);
|
||||
}
|
||||
|
||||
public function asignarTecnico(int $tecnicoId)
|
||||
{
|
||||
$this->attributes['tecnico_id'] = $tecnicoId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function cambiarEstado(int $estadoId)
|
||||
{
|
||||
$this->attributes['estado_id'] = $estadoId;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user