Persona conectada con Propietario
This commit is contained in:
@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user