Files
operadores/api/src/Unidad.php

31 lines
855 B
PHP
Raw Normal View History

2021-08-10 15:48:33 -04:00
<?php
namespace Incoviba;
use \Model;
class Unidad extends Model {
public static $_table = 'unidad';
protected $propiedad_unidad;
public function propiedad_unidad() {
if ($this->propiedad_unidad === null) {
$this->propiedad_unidad = $this->has_one(PropiedadUnidad::class, 'unidad')->find_one();
}
return $this->propiedad_unidad;
}
2021-08-16 22:13:08 -04:00
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;
}
2021-08-10 15:48:33 -04:00
}