Propiedad principal
This commit is contained in:
@ -7,6 +7,14 @@ use Incoviba\Model;
|
||||
class Propiedad extends Ideal\Model
|
||||
{
|
||||
public array $unidades = [];
|
||||
|
||||
public function principal(): Unidad
|
||||
{
|
||||
if (count($this->departamentos()) > 0) {
|
||||
return $this->departamentos()[0];
|
||||
}
|
||||
return $this->unidades[0];
|
||||
}
|
||||
protected array $departamentos;
|
||||
public function departamentos(): array
|
||||
{
|
||||
|
Reference in New Issue
Block a user