Files
safekat/ci4/app/Entities/Soporte/TicketEntity.php

53 lines
1.2 KiB
PHP

<?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;
}
}