Persona conectada con Propietario

This commit is contained in:
Juan Pablo Vial
2025-05-07 19:24:33 -04:00
parent 3903551176
commit f3e15b34a8
2 changed files with 47 additions and 5 deletions

View File

@ -1,6 +1,7 @@
<?php
namespace Incoviba\Model;
use InvalidArgumentException;
use Incoviba\Common\Ideal;
use Incoviba\Model\Persona\Datos;
@ -31,6 +32,20 @@ class Persona extends Ideal\Model
return $this->datos;
}
public function __get(string $name): mixed
{
if (property_exists($this, $name)) {
return $this->{$name};
}
if ($name === 'datos') {
return $this->datos();
}
if ($name === 'dv') {
return $this->digito;
}
throw new InvalidArgumentException("Property {$name} is not found in " . __CLASS__);
}
public function jsonSerialize(): mixed
{
return [