public static function addRoleToUser(int $userId, int $roleId)
 {
     $db = Database::getInstance('app');
     $result = $db->prepare("\r\n            insert into user_roles values(:userId, :roleId);\r\n        ");
     $result->execute([':userId' => $userId, ':roleId' => $roleId]);
 }
 private static function insert(Lecture $model)
 {
     $db = Database::getInstance('app');
     $query = "INSERT INTO lectures (id,speakerid,hallid,name,startdatatime,enddatatime)\r\n                    VALUES (':id', ':speakerid', ':hallid', ':name', ':startdatatime', ':enddatatime')";
     $result = $db->prepare($query);
     $result->execute([':id' => $model->getId(), ':speakerid' => $model->getSpeakerId(), ':hallid' => $model->getHallId(), ':name' => $model->getName(), ':startdatatime' => $model->getStartDateTime(), ':enddatatime' => $model->getEndDateTime()]);
     $model->setId((int) $db->lastId());
 }
 private static function insert(Hall $model)
 {
     $db = Database::getInstance('app');
     $query = "INSERT INTO halls (id,name,venueid,userlimit)\r\n                    VALUES (':id', ':name', ':venueid','userlimit')";
     $result = $db->prepare($query);
     $result->execute([':id' => $model->getId(), ':name' => $model->getName(), ':venueid' => $model->getVenueId(), ':userlimit' => $model->getUserLimit()]);
     $model->setId((int) $db->lastId());
 }
 private static function insert(Venue $model)
 {
     $db = Database::getInstance('app');
     $query = "INSERT INTO venues (id,name,address)\r\n                    VALUES (':id', ':name', ':address')";
     $result = $db->prepare($query);
     $result->execute([':id' => $model->getId(), ':name' => $model->getName(), ':address' => $model->getAddress()]);
     $model->setId((int) $db->lastId());
 }
 private static function insert(Conference $model)
 {
     $db = Database::getInstance('app');
     $query = "INSERT INTO conferences (ownerid,administratorid,venueid,name,startdatatime,enddatatime)\r\n                    VALUES (':ownerid', ':administratorid', ':venueid', ':name', ':startdatatime', ':enddatatime')";
     $result = $db->prepare($query);
     $result->execute([':ownerid' => $model->getOwnerId(), ':administratorid' => $model->getAdministratorId(), ':id' => $model->getId(), ':venueid' => $model->getVenueId(), ':name' => $model->getName(), ':startdatatime' => $model->getStartDateTime(), ':enddatatime' => $model->getEndDateTime()]);
     $model->setId((int) $db->lastId());
 }
 private static function insert(IdentityUser $model)
 {
     $db = Database::getInstance('app');
     $query = "INSERT INTO users (username,password) VALUES ('" . $model->getUsername() . "', '" . $model->getPassword() . "')";
     $result = $db->prepare($query);
     $result->execute([]);
     $model->setId((int) $db->lastId());
 }