Edit Proveedores

This commit is contained in:
Juan Pablo Vial
2024-12-03 17:35:29 -03:00
parent 42e1dcdff7
commit 187b6f6f05
9 changed files with 232 additions and 49 deletions

View File

@ -30,18 +30,9 @@ class Persona extends Ideal\Repository
}
public function edit(Define\Model $model, array $new_data): Model\Persona
{
return $this->update($model, $new_data, ['rut', 'digito', 'nombres', 'apellido_paterno', 'apellido_materno']);
return $this->update($model, ['digito', 'nombres', 'apellido_paterno', 'apellido_materno'], $new_data);
}
/*public function fetchById(int $rut): Model\Persona
{
$query = $this->connection->getQueryBuilder()
->select()
->from($this->getTable())
->where('rut = ?');
return $this->fetchOne($query, [$rut]);
}*/
public function filterData(array $data): array
{
return array_intersect_key($data, array_flip(['rut', 'digito', 'nombres', 'apellido_paterno', 'apellido_materno']));

View File

@ -80,9 +80,4 @@ class Datos extends Ideal\Repository
->where('persona_rut = ?');
return $this->fetchOne($query, [$persona_rut]);
}
protected function getKey(): string
{
return 'persona_rut';
}
}