public function delete(Publication $publication) { $table = $publication->getTableName(); $statement = "DELETE FROM {$table} WHERE id = :id LIMIT 1"; $query = $this->session->prepare($statement); $query->bindParam(":id", $publication->id()); try { $query->execute(); return $query->rowCount() > 0; } catch (PDOException $err) { throw new PDOException($err->getMessage()); } }