Implemented repository mapper, and venta show

This commit is contained in:
Juan Pablo Vial
2023-08-08 23:53:49 -04:00
parent ef30ae67d2
commit 59825259b6
111 changed files with 2766 additions and 612 deletions

View File

@ -1,8 +1,9 @@
<?php
namespace Incoviba\Repository;
use Incoviba\Common\Ideal;
use Incoviba\Common\Define;
use Incoviba\Common\Ideal;
use Incoviba\Common\Implement;
use Incoviba\Model;
use Incoviba\Repository;
@ -21,23 +22,16 @@ class Inmobiliaria extends Ideal\Repository
public function create(?array $data = null): Define\Model
{
$map = [
'dv' => [],
'razon' => [],
'abreviacion' => [],
'cuenta' => [],
'banco' => [
'function' => function($data) {
$map = (new Implement\Repository\MapperParser(['db', 'razon', 'abreviacion', 'cuenta']))
->register('banco', (new Implement\Repository\Mapper())
->setFunction(function($data) {
return $this->bancoRepository->fetchById($data['banco']);
}
],
'sociedad' => [
'property' => 'tipoSociedad',
'function' => function($data) {
}))
->register('sociedad', (new Implement\Repository\Mapper())
->setProperty('tipoSociedad')
->setFunction(function($data) {
return $this->tipoSociedadRepository->fetchById($data['sociedad']);
}
]
];
}));
return $this->parseData(new Model\Inmobiliaria(), $data, $map);
}
public function save(Define\Model $model): Define\Model