Skip to content

Commit

Permalink
remove query and exec 2 arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
JanHuang committed May 10, 2017
1 parent 926149b commit 25988b6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Model/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,39 +53,37 @@ public function reconnect()

/**
* @param $query
* @param array $map
* @return bool|\PDOStatement
*/
public function query($query, $map = [])
public function query($query)
{
try {
return parent::query($query, $map);
return parent::query($query);
} catch (PDOException $e) {
if ('HY000' !== $e->getCode()) {
throw $e;
}
$this->reconnect();

return parent::query($query, $map);
return parent::query($query);
}
}

/**
* @param $query
* @param array $map
* @return bool|\PDOStatement
*/
public function exec($query, $map = [])
public function exec($query)
{
try {
return parent::exec($query, $map);
return parent::exec($query);
} catch (PDOException $e) {
if ('HY000' !== $e->getCode()) {
throw $e;
}
$this->reconnect();

return parent::exec($query, $map);
return parent::exec($query);
}
}
}

0 comments on commit 25988b6

Please sign in to comment.