FIX: Tipo Cuenta
This commit is contained in:
@ -62,7 +62,11 @@ class Mapper implements Define\Repository\Mapper
|
|||||||
}
|
}
|
||||||
$value = $data[$column];
|
$value = $data[$column];
|
||||||
if ($this->hasFunction()) {
|
if ($this->hasFunction()) {
|
||||||
$value = ($this->function)($data);
|
if ($value !== null) {
|
||||||
|
$value = ($this->function)($data);
|
||||||
|
} elseif ($this->hasDefault()) {
|
||||||
|
$value = $this->default;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$model->{$property} = $value;
|
$model->{$property} = $value;
|
||||||
return true;
|
return true;
|
||||||
|
@ -31,7 +31,7 @@ class CentroCosto extends Ideal\Repository
|
|||||||
->setFunction(function(array $data) {
|
->setFunction(function(array $data) {
|
||||||
return $this->categoriaCentroRepository->fetchById($data['categoria_id']);
|
return $this->categoriaCentroRepository->fetchById($data['categoria_id']);
|
||||||
}))
|
}))
|
||||||
->register('tipo_cuenta', (new Mapper())
|
->register('tipo_cuenta_id', (new Mapper())
|
||||||
->setProperty('tipoCuenta')
|
->setProperty('tipoCuenta')
|
||||||
->setFunction(function(array $data) {
|
->setFunction(function(array $data) {
|
||||||
return $this->tipoCuentaRepository->fetchById($data['tipo_cuenta_id']);
|
return $this->tipoCuentaRepository->fetchById($data['tipo_cuenta_id']);
|
||||||
|
Reference in New Issue
Block a user