FIX: casos en que PDO::execute retorna falso, pero sin tirar PDOException
DateTime con parametro pasado DateTime Model::jsonComplement
This commit is contained in:
@ -26,7 +26,13 @@ abstract class Model implements Define\Model
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
'id' => $this->id
|
||||
'id' => $this->id,
|
||||
...$this->jsonComplement()
|
||||
];
|
||||
}
|
||||
|
||||
protected function jsonComplement(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -204,9 +204,11 @@ abstract class Repository implements Define\Repository
|
||||
{
|
||||
try {
|
||||
$result = $this->connection->execute($query, $data)->fetch(PDO::FETCH_ASSOC);
|
||||
if ($result === false) {
|
||||
throw new EmptyResult($query);
|
||||
}
|
||||
} catch (PDOException $exception) {
|
||||
throw new EmptyResult($query, $exception);
|
||||
|
||||
}
|
||||
return $this->load($result);
|
||||
}
|
||||
|
Reference in New Issue
Block a user