public function unsetPermission(Player $player, Zone $zone) { $prepare = $this->database->prepare("DELETE FROM Permissions WHERE player_name = :name AND zone_name = :zone"); $prepare->bindValue(":name", \SQLite3::escapeString($player->getName()), SQLITE3_TEXT); $prepare->bindValue(":zone", \SQLite3::escapeString($zone->getName()), SQLITE3_TEXT); $prepare->execute(); }
public function unsetPermission(Player $player, Zone $zone) { $player = $this->database->escape_string($player->getName()); $zoneName = $this->database->escape_string($zone->getName()); return $this->database->query("DELETE FROM izone_player_permissions WHERE player_name = {$player} AND zone_name = {$zoneName}"); }
public function unsetPermission(Player $player, Zone $zone) { $zoneName = $zone->getName(); $data = $this->permConfig->get($player->getName() . ".permissions", []); if (count($data) == 0 || !array_key_exists($zoneName, $data)) { return false; } unset($data[$zoneName]); $this->permConfig->set($player->getName() . ".permissions", $data); return true; }