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

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