protected function prepareStatement($db, $query) {
try {
$stmt = $db
->prepare($query);
} catch (\Exception $e) {
$stmt = false;
}
if (false === $stmt) {
throw new \RuntimeException('The database cannot successfully prepare the statement');
}
return $stmt;
}