FIX: Busqueda no funcionaba

This commit is contained in:
Juan Pablo Vial
2025-04-09 09:29:53 -04:00
parent 3c2b486083
commit bc49ba7629
2 changed files with 11 additions and 7 deletions

View File

@ -575,7 +575,11 @@ class Venta extends Ideal\Repository
protected function fetchId(string $query, ?array $data = null): array
{
try {
return $this->connection->execute($query, $data)->fetch(PDO::FETCH_ASSOC);
$result = $this->connection->execute($query, $data)->fetch(PDO::FETCH_ASSOC);
if ($result === false) {
throw new Implement\Exception\EmptyResult($query);
}
return $result;
} catch (PDOException $exception) {
throw new Implement\Exception\EmptyResult($query, $exception);
}