public function __construct() { $db = new DatabaseConnection(); $this->dbConnection = $db->dbConnection(); }
public function deleteMenu($id) { $db = new DatabaseConnection(); $this->dbConnection = $db->dbConnection(); $this->prepareStatement('@id', 'i', $id); if (!$this->dbConnection->query('CALL delete_by_id(@id)')) { throw new DatabaseErrorException($this->dbConnection->error); } $this->dbConnection->close(); }