mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Primera version del importador de Bubok
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entities\Cliente;
|
||||
namespace App\Entities\Clientes;
|
||||
|
||||
use CodeIgniter\Entity;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
use App\Models\Configuracion\PaisModel;
|
||||
|
||||
class ClienteDireccionesEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
@ -23,4 +25,29 @@ class ClienteDireccionesEntity extends \CodeIgniter\Entity\Entity
|
||||
"pais_id" => "int",
|
||||
"cp" => "int",
|
||||
];
|
||||
|
||||
public function getClienteNombre(): ?string
|
||||
{
|
||||
if (!$this->cliente_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$clienteModel = model(ClienteModel::class);
|
||||
$cliente = $clienteModel->find($this->cliente_id);
|
||||
|
||||
return $cliente ? $cliente->nombre : null;
|
||||
}
|
||||
|
||||
public function getPaisNombre(): ?string
|
||||
{
|
||||
if (!$this->pais_id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$paisModel = model(PaisModel::class);
|
||||
$pais = $paisModel->find($this->pais_id);
|
||||
|
||||
return $pais ? $pais->nombre : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user