FIX: Banco vacio o con espacio

This commit is contained in:
Juan Pablo Vial
2025-02-04 12:09:34 -03:00
parent 4073b96796
commit 9f56604917
3 changed files with 9 additions and 13 deletions

View File

@ -68,18 +68,14 @@ class Mapper implements Define\Repository\Mapper
}
$value = $data[$column];
if ($this->hasFunction()) {
if ($value !== null and $value !== '') {
try {
$value = ($this->function)($data);
} catch (EmptyResult $exception) {
if ($this->hasDefault()) {
$value = $this->default;
} else {
throw $exception;
}
try {
$value = ($this->function)($data);
} catch (EmptyResult $exception) {
if ($this->hasDefault()) {
$value = $this->default;
} else {
throw $exception;
}
} elseif ($this->hasDefault()) {
$value = $this->default;
}
}
$model->{$property} = $value;