Subir cartolas procesadas
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user