Restructura contabilidad

This commit is contained in:
Juan Pablo Vial
2024-03-26 09:38:20 -03:00
parent 4b3397dd63
commit 5f56022109
57 changed files with 311 additions and 291 deletions

View File

@ -0,0 +1,34 @@
<?php
namespace Incoviba\Repository\Contabilidad;
use Incoviba\Common\Define;
use Incoviba\Common\Ideal;
use Incoviba\Common\Implement;
use Incoviba\Model;
class Banco extends Ideal\Repository
{
public function __construct(Define\Connection $connection)
{
parent::__construct($connection);
$this->setTable('banco');
}
public function create(?array $data = null): Define\Model
{
$map = new Implement\Repository\MapperParser(['nombre']);
return $this->parseData(new Model\Contabilidad\Banco(), $data, $map);
}
public function save(Define\Model $model): Define\Model
{
$model->id = $this->saveNew(
['nombre'],
[$model->nombre]
);
return $model;
}
public function edit(Define\Model $model, array $new_data): Define\Model
{
return $this->update($model, ['nombre'], $new_data);
}
}