propiedad_unidad === null) { $this->propiedad_unidad = $this->has_one(PropiedadUnidad::class, 'unidad')->find_one(); } 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; } }