Listado proyectos

This commit is contained in:
2023-10-13 10:45:21 -03:00
parent 0d558b7980
commit c2a3192b32
26 changed files with 612 additions and 58 deletions

View File

@ -17,7 +17,7 @@ class EstadoVenta extends Ideal\Repository
$this->setTable('estado_venta');
}
public function create(?array $data = null): Define\Model
public function create(?array $data = null): Model\Venta\EstadoVenta
{
$map = (new Implement\Repository\MapperParser())
->register('venta', (new Implement\Repository\Mapper())
@ -32,7 +32,7 @@ class EstadoVenta extends Ideal\Repository
->register('fecha', new Implement\Repository\Mapper\DateTime('fecha'));
return $this->parseData(new Model\Venta\EstadoVenta(), $data, $map);
}
public function save(Define\Model $model): Define\Model
public function save(Define\Model $model): Model\Venta\EstadoVenta
{
$model->id = $this->saveNew(
['venta', 'estado', 'fecha'],
@ -40,7 +40,7 @@ class EstadoVenta extends Ideal\Repository
);
return $model;
}
public function edit(Define\Model $model, array $new_data): Define\Model
public function edit(Define\Model $model, array $new_data): Model\Venta\EstadoVenta
{
return $this->update($model, ['venta', 'estado', 'fecha'], $new_data);
}
@ -50,7 +50,7 @@ class EstadoVenta extends Ideal\Repository
$query = "SELECT * FROM `{$this->getTable()}` WHERE `venta` = ?";
return $this->fetchMany($query, [$venta_id]);
}
public function fetchCurrentByVenta(int $venta_id): Define\Model
public function fetchCurrentByVenta(int $venta_id): Model\Venta\EstadoVenta
{
$query = "SELECT a.*
FROM `{$this->getTable()}` a