public function lock($key, $force = true) { Logger::debug("Locking: '" . $key . "'"); $updateMethod = $force ? "insertOrUpdate" : "insert"; $this->db->{$updateMethod}("locks", ["id" => $key, "date" => time()]); }