mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Revisados formularios de crear y editar, con su validacion
This commit is contained in:
@ -4,7 +4,10 @@ namespace App\Entities\Catalogo;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use App\Models\Configuracion\PapelGenericoModel;
|
||||
use App\Models\Configuracion\TipoPresupuestoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use App\Models\Tarifas\Acabados\ServicioAcabadoModel;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
class CatalogoLibroEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
@ -104,6 +107,44 @@ class CatalogoLibroEntity extends Entity
|
||||
|
||||
];
|
||||
|
||||
public function getClienteName()
|
||||
{
|
||||
if (!$this->cliente_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$cliente = model(ClienteModel::class)->find($this->cliente_id);
|
||||
return $cliente->nombre ?? null;
|
||||
}
|
||||
|
||||
public function getEncuadernacionName()
|
||||
{
|
||||
if (!$this->encuadernacion_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$enc = model(TipoPresupuestoModel::class)->find($this->encuadernacion_id);
|
||||
return $enc->encuadernacion ?? null;
|
||||
}
|
||||
|
||||
public function getCreatedUser()
|
||||
{
|
||||
if (!$this->user_created_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return model(UserModel::class)->getFullName($this->user_created_id);
|
||||
}
|
||||
|
||||
public function getUpdatedUser()
|
||||
{
|
||||
if (!$this->user_update_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return model(UserModel::class)->getFullName($this->user_update_id);
|
||||
}
|
||||
|
||||
|
||||
public function getNegroPapelName()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user