Files
safekat/ci4/app/Entities/Presupuestos/PresupuestoManipuladosEntity.php
2024-12-24 12:51:44 +01:00

32 lines
909 B
PHP

<?php
namespace App\Entities\Presupuestos;
use App\Models\Tarifas\Maquinas\TarifaManipuladoMaquinaModel;
use CodeIgniter\Entity;
class PresupuestoManipuladosEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"presupuesto_id" => null,
"tarifa_manipulado_id" => null,
"precio_unidad" => null,
"precio_total" => null,
"margen" => null,
"created_at" => null,
"updated_at" => null,
];
protected $casts = [
"presupuesto_id" => "int",
"tarifa_manipulado_id" => "int",
"precio_unidad" => "float",
"precio_total" => "float",
"margen" => "float",
];
public function maquinas() : array
{
$m = model(TarifaManipuladoMaquinaModel::class);
return $m->where("tarifa_manipulado_id",$this->attributes["tarifa_manipulado_id"])->findAll();
}
}