Files
safekat/ci4/app/Entities/Configuracion/PapelImpresion.php
2025-01-21 09:56:59 +01:00

72 lines
2.2 KiB
PHP
Executable File

<?php
namespace App\Entities\Configuracion;
use App\Models\Configuracion\MaquinasPapelesImpresionModel;
use App\Models\Configuracion\PapelImpresionMargenModel;
use App\Models\Configuracion\PapelImpresionTipologiaModel;
use CodeIgniter\Entity;
class PapelImpresion extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"papel_generico_id" => null,
"nombre" => null,
"defecto" => false,
"referencia" => null,
"mano" => null,
"espesor" => 0.0,
"gramaje" => null,
"precio_tonelada" => null,
"interior" => true,
"bn" => true,
"color" => true,
"cubierta" => false,
"sobrecubierta" => false,
"guardas" => false,
"inkjet" => false,
"rotativa" => false,
"isActivo" => true,
"use_in_client" => false,
"use_for_tapa_dura" => false,
"is_deleted" => 0,
"created_at" => null,
"updated_at" => null,
];
protected $casts = [
"papel_generico_id" => "int",
"defecto" => "boolean",
"mano" => "float",
"espesor" => "float",
"gramaje" => "float",
"precio_tonelada" => "float",
"interior" => "boolean",
"bn" => "boolean",
"color" => "boolean",
"cubierta" => "boolean",
"sobrecubierta" => "boolean",
"guardas" => "boolean",
"rotativa" => "boolean",
"isActivo" => "boolean",
"use_in_client" => "boolean",
"use_for_tapa_dura" => "boolean",
"is_deleted" => "int",
];
public function tipologia() : ?array
{
$m = model(PapelImpresionTipologiaModel::class);
return $m->asArray()->where('papel_impresion_id',$this->attributes["id"])->findAll();
}
public function maquinas_impresion() : ?array
{
$m = model(MaquinasPapelesImpresionModel::class);
return $m->asArray()->where('papel_impresion_id',$this->attributes["id"])->findAll();
}
public function margen() : ?array
{
$m = model(PapelImpresionMargenModel::class);
return $m->asArray()->where('papel_impresion_id',$this->attributes["id"])->findAll();
}
}