Implemented repository mapper, and venta show
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user