nombres . ' ' . $this->apellidoPaterno . ' ' . $this->apellidoMaterno; } public function rutCompleto(): string { return number_format($this->rut, 0, ',', '.') . '-' . $this->digito; } protected ?Datos $datos; public function datos(): ?Datos { if (!isset($this->datos)) { $this->datos = $this->runFactory('datos'); } return $this->datos; } public function jsonSerialize(): mixed { return [ 'rut' => $this->rut, 'digito' => $this->digito, 'nombres' => $this->nombres, 'apellidoPaterno' => $this->apellidoPaterno, 'apellidoMaterno' => $this->apellidoMaterno, 'nombreCompleto' => $this->nombreCompleto(), 'rutCompleto' => $this->rutCompleto(), 'datos' => $this->datos() ?? null, ]; } }