feature/cierres (#25)

Varios cambios

Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl>
Reviewed-on: #25
This commit is contained in:
2025-07-22 13:18:00 +00:00
parent ba57cad514
commit 307f2ac7d7
418 changed files with 20045 additions and 984 deletions

View File

@ -24,6 +24,11 @@ abstract class Repository implements Define\Repository
return $this;
}
public function getConnection(): Define\Connection
{
return $this->connection;
}
public function load(array $data_row): Define\Model
{
$model = $this->create($data_row);
@ -189,7 +194,7 @@ abstract class Repository implements Define\Repository
try {
$this->connection->execute($query, $values);
} catch (PDOException $exception) {
throw new EmptyResult($query, $exception);
throw new EmptyResult($query, $exception, $data);
}
return $this->fetchById($this->getIndex($model));
}
@ -205,10 +210,10 @@ abstract class Repository implements Define\Repository
try {
$result = $this->connection->execute($query, $data)->fetch(PDO::FETCH_ASSOC);
if ($result === false) {
throw new EmptyResult($query);
throw new EmptyResult($query, null, $data);
}
} catch (PDOException $exception) {
throw new EmptyResult($query, $exception);
throw new EmptyResult($query, $exception, $data);
}
return $this->load($result);
}
@ -224,7 +229,7 @@ abstract class Repository implements Define\Repository
try {
$results = $this->connection->execute($query, $data)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $exception) {
throw new EmptyResult($query, $exception);
throw new EmptyResult($query, $exception, $data);
}
return array_map([$this, 'load'], $results);
}
@ -240,7 +245,7 @@ abstract class Repository implements Define\Repository
try {
$results = $this->connection->execute($query, $data)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $exception) {
throw new EmptyResult($query, $exception);
throw new EmptyResult($query, $exception, $data);
}
return $results;
}