Skip to content

Commit

Permalink
fix Medoo >= v1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
longxinH authored Apr 29, 2021
1 parent 4fe6f5f commit 67fce7d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Model/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,29 @@ public function reconnect()
* @param $query
* @return bool|false|\PDOStatement
*/
public function query($query)
public function query($query, $map = [])
{
try {
return $this->pdo->query($query);
return parent::query($query, $map);
} catch (Exception $e) {
$this->reconnect();

return $this->pdo->query($query);
return parent::query($query, $map);
}
}

/**
* @param $query
* @return bool|int
*/
public function exec($query)
public function exec($query, $map = [])
{
try {
return $this->pdo->exec($query);
return parent::exec($query, $map);
} catch (Exception $e) {
$this->reconnect();

return $this->pdo->exec($query);
return parent::exec($query, $map);
}
}

Expand Down

0 comments on commit 67fce7d

Please sign in to comment.