Skip to content

Commit 1fd0bd3

Browse files
committed
rename confusing constant
1 parent a1679de commit 1fd0bd3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: resources/lib/UnitySQL.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class UnitySQL
2121
private const TABLE_GROUP_JOIN_REQUESTS = "groupJoinRequests";
2222

2323

24-
private const REQUEST_ADMIN = "admin";
24+
// FIXME this string should be changed to something more intuitive, requires production sql change
25+
private const REQUEST_BECOME_PI = "admin";
2526

2627
private $conn;
2728

@@ -39,7 +40,7 @@ public function getConn()
3940
//
4041
// requests table methods
4142
//
42-
public function addRequest($requestor, $dest = self::REQUEST_ADMIN)
43+
public function addRequest($requestor, $dest = self::REQUEST_BECOME_PI)
4344
{
4445
if ($this->requestExists($requestor, $dest)) {
4546
return;
@@ -54,7 +55,7 @@ public function addRequest($requestor, $dest = self::REQUEST_ADMIN)
5455
$stmt->execute();
5556
}
5657

57-
public function removeRequest($requestor, $dest = self::REQUEST_ADMIN)
58+
public function removeRequest($requestor, $dest = self::REQUEST_BECOME_PI)
5859
{
5960
if (!$this->requestExists($requestor, $dest)) {
6061
return;
@@ -69,7 +70,7 @@ public function removeRequest($requestor, $dest = self::REQUEST_ADMIN)
6970
$stmt->execute();
7071
}
7172

72-
public function removeRequests($dest = self::REQUEST_ADMIN)
73+
public function removeRequests($dest = self::REQUEST_BECOME_PI)
7374
{
7475
$stmt = $this->conn->prepare(
7576
"DELETE FROM " . self::TABLE_REQS . " WHERE request_for=:request_for"
@@ -79,7 +80,7 @@ public function removeRequests($dest = self::REQUEST_ADMIN)
7980
$stmt->execute();
8081
}
8182

82-
public function requestExists($requestor, $dest = self::REQUEST_ADMIN)
83+
public function requestExists($requestor, $dest = self::REQUEST_BECOME_PI)
8384
{
8485
$stmt = $this->conn->prepare(
8586
"SELECT * FROM " . self::TABLE_REQS . " WHERE uid=:uid and request_for=:request_for"
@@ -92,7 +93,7 @@ public function requestExists($requestor, $dest = self::REQUEST_ADMIN)
9293
return count($stmt->fetchAll()) > 0;
9394
}
9495

95-
public function getRequests($dest = self::REQUEST_ADMIN)
96+
public function getRequests($dest = self::REQUEST_BECOME_PI)
9697
{
9798
$stmt = $this->conn->prepare(
9899
"SELECT * FROM " . self::TABLE_REQS . " WHERE request_for=:request_for"

0 commit comments

Comments
 (0)