Show Proyecto
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace Incoviba\Model;
|
||||
|
||||
use Incoviba\Common\Alias\Model;
|
||||
use Incoviba\Common\Ideal;
|
||||
|
||||
class Proyecto extends Ideal\Model
|
||||
@ -15,6 +16,9 @@ class Proyecto extends Ideal\Model
|
||||
public int $subterraneos;
|
||||
protected Proyecto\Etapa $etapa;
|
||||
|
||||
protected array $estados;
|
||||
protected Proyecto\EstadoProyecto $currentEstado;
|
||||
|
||||
public function inmobiliaria(): Inmobiliaria
|
||||
{
|
||||
if (!isset($this->inmobiliaria)) {
|
||||
@ -29,6 +33,20 @@ class Proyecto extends Ideal\Model
|
||||
}
|
||||
return $this->direccion;
|
||||
}
|
||||
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
|
||||
{
|
||||
|
@ -5,4 +5,9 @@ class Superficie
|
||||
{
|
||||
public float $sobre_nivel;
|
||||
public float $bajo_nivel;
|
||||
|
||||
public function total(): float
|
||||
{
|
||||
return $this->bajo_nivel + $this->sobre_nivel;
|
||||
}
|
||||
}
|
||||
|
@ -9,15 +9,15 @@ class Propiedad extends Ideal\Model
|
||||
|
||||
public function departamentos(): array
|
||||
{
|
||||
return array_filter($this->unidades, function(Unidad $unidad) {return $unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'departamento';});
|
||||
return array_values(array_filter($this->unidades, function(Unidad $unidad) {return $unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'departamento';}));
|
||||
}
|
||||
public function estacionamientos(): array
|
||||
{
|
||||
return array_filter($this->unidades, function(Unidad $unidad) {return $unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'estacionamiento';});
|
||||
return array_values(array_filter($this->unidades, function(Unidad $unidad) {return $unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'estacionamiento';}));
|
||||
}
|
||||
public function bodegas(): array
|
||||
{
|
||||
return array_filter($this->unidades, function(Unidad $unidad) {return $unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'bodega';});
|
||||
return array_values(array_filter($this->unidades, function(Unidad $unidad) {return $unidad->proyectoTipoUnidad->tipoUnidad->descripcion === 'bodega';}));
|
||||
}
|
||||
|
||||
protected float $vendible;
|
||||
|
Reference in New Issue
Block a user