FIX: Key de prorrateo

This commit is contained in:
Juan Pablo Vial
2024-11-29 18:22:08 -03:00
parent 44f32d9e5f
commit 606b99a0f9
2 changed files with 9 additions and 2 deletions

View File

@ -63,9 +63,15 @@ abstract class Repository implements Define\Repository
return $this->fetchMany($query);
}
protected string $key = 'id';
public function setKey(string $key): Repository
{
$this->key = $key;
return $this;
}
protected function getKey(): string
{
return 'id';
return $this->key;
}
protected function parseData(Define\Model $model, ?array $data, Implement\Repository\MapperParser $data_map): Define\Model
{

View File

@ -12,7 +12,8 @@ class Prorrateo extends Ideal\Repository
public function __construct(Define\Connection $connection, protected Repository\Venta\Unidad $unidadRepository)
{
parent::__construct($connection);
$this->setTable('unidad_prorrateo');
$this->setTable('unidad_prorrateo')
->setKey('unidad_id');
}
public function create(?array $data = null): Model\Venta\Unidad\Prorrateo