Subir cartolas procesadas

This commit is contained in:
Juan Pablo Vial
2024-07-17 22:33:33 -04:00
parent 390e79ad6d
commit 8e7f43e487
48 changed files with 1692 additions and 530 deletions

View File

@ -4,6 +4,7 @@ namespace Incoviba\Common\Implement\Repository;
use Error;
use Closure;
use Incoviba\Common\Define;
use Incoviba\Common\Implement\Exception\EmptyResult;
class Mapper implements Define\Repository\Mapper
{
@ -68,7 +69,15 @@ class Mapper implements Define\Repository\Mapper
$value = $data[$column];
if ($this->hasFunction()) {
if ($value !== null) {
$value = ($this->function)($data);
try {
$value = ($this->function)($data);
} catch (EmptyResult $exception) {
if ($this->hasDefault()) {
$value = $this->default;
} else {
throw $exception;
}
}
} elseif ($this->hasDefault()) {
$value = $this->default;
}