API
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user