Files
oficial/app/src/Model/Proyecto.php

65 lines
1.8 KiB
PHP
Raw Normal View History

<?php
namespace Incoviba\Model;
2023-10-20 19:03:29 -03:00
use Incoviba\Common\Alias\Model;
2023-07-28 16:22:20 -04:00
use Incoviba\Common\Ideal;
2023-07-28 16:22:20 -04:00
class Proyecto extends Ideal\Model
{
protected Inmobiliaria $inmobiliaria;
public string $descripcion;
protected Direccion $direccion;
2023-07-28 16:22:20 -04:00
public Proyecto\Terreno $terreno;
public Proyecto\Superficie $superficie;
public float $corredor;
public int $pisos;
public int $subterraneos;
2023-10-13 10:45:21 -03:00
protected Proyecto\Etapa $etapa;
2023-10-20 19:03:29 -03:00
protected array $estados;
protected Proyecto\EstadoProyecto $currentEstado;
public function inmobiliaria(): Inmobiliaria
{
if (!isset($this->inmobiliaria)) {
$this->inmobiliaria = $this->runFactory('inmobiliaria');
}
return $this->inmobiliaria;
}
public function direccion(): Direccion
{
if (!isset($this->direccion)) {
$this->direccion = $this->runFactory('direccion');
}
return $this->direccion;
}
2023-10-20 19:03:29 -03:00
public function estados(): array
{
if (!isset($this->estados)) {
$this->estados = $this->runFactory('estados');
}
return $this->estados;
}
public function currentEstado(): Proyecto\EstadoProyecto
{
if (!isset($this->currentEstado)) {
$this->currentEstado = $this->runFactory('currentEstado');
}
return $this->currentEstado;
}
public function jsonSerialize(): mixed
{
return array_merge(parent::jsonSerialize(), [
'inmobiliaria' => $this->inmobiliaria(),
'descripcion' => $this->descripcion,
'direccion' => $this->direccion(),
'terreno' => $this->terreno,
'superficie' => $this->superficie,
'corredor' => $this->corredor,
'pisos' => $this->pisos,
'subterraneos' => $this->subterraneos
]);
}
}