This commit is contained in:
2021-08-16 22:13:08 -04:00
parent 740de41139
commit 49374254e4
24 changed files with 466 additions and 58 deletions

View File

@ -13,4 +13,18 @@ class Unidad extends Model {
}
return $this->propiedad_unidad;
}
protected $proyecto_tipo_unidad;
public function proyecto_tipo_unidad() {
if ($this->proyecto_tipo_unidad === null) {
$this->proyecto_tipo_unidad = $this->belongs_to(ProyectoTipoUnidad::class, 'pt')->find_one();
}
return $this->proyecto_tipo_unidad;
}
protected $facturas;
public function facturas() {
if ($this->facturas === null) {
$this->facturas = $this->has_many(FacturaUnidad::class, 'unidad_id')->find_many();
}
return $this->facturas;
}
}