Conecciones de Promociones

This commit is contained in:
Juan Pablo Vial
2025-04-03 13:15:56 -03:00
parent ced673e452
commit 8a1e6a7761
17 changed files with 1144 additions and 79 deletions

View File

@ -43,6 +43,15 @@ class ProyectoTipoUnidad extends Ideal\Model
return $this->abreviacion;
}
protected array $unidades;
public function unidades(): array
{
if (!isset($this->unidades)) {
$this->unidades = $this->runFactory('unidades');
}
return $this->unidades;
}
public function jsonSerialize(): mixed
{
return array_merge(parent::jsonSerialize(), [

View File

@ -21,7 +21,7 @@ class Promotion extends Common\Ideal\Model
public function projects(): array
{
if (empty($this->projects)) {
$this->projects = $this->runFactory('projects');
$this->projects = $this->runFactory('projects') ?? [];
}
return $this->projects;
}
@ -30,16 +30,33 @@ class Promotion extends Common\Ideal\Model
public function contracts(): array
{
if (empty($this->contracts)) {
$this->contracts = $this->runFactory('contracts');
$this->contracts = $this->runFactory('contracts') ?? [];
}
return $this->contracts;
}
protected array $unitTypes;
public function unitTypes(): array
{
if (empty($this->unitTypes)) {
$this->unitTypes = $this->runFactory('unitTypes') ?? [];
}
return $this->unitTypes;
}
protected array $unitLines;
public function unitLines(): array
{
if (empty($this->unitLines)) {
$this->unitLines = $this->runFactory('unitLines') ?? [];
}
return $this->unitLines;
}
protected array $units;
public function units(): array
{
if (empty($this->units)) {
$this->units = $this->runFactory('units');
$this->units = $this->runFactory('units') ?? [];
}
return $this->units;
}