함수 이름 변경
This commit is contained in:
+14
-16
@@ -124,13 +124,11 @@ class Message
|
|||||||
];
|
];
|
||||||
|
|
||||||
$action = Util::array_get($option['action'], null);
|
$action = Util::array_get($option['action'], null);
|
||||||
if($msgType === self::MSGTYPE_DIPLOMACY){
|
if ($msgType === self::MSGTYPE_DIPLOMACY) {
|
||||||
$objMessage = new DiplomacticMessage(...$args);
|
$objMessage = new DiplomacticMessage(...$args);
|
||||||
}
|
} elseif ($action === 'scout') {
|
||||||
else if($action === 'scout'){
|
|
||||||
$objMessage = new ScoutMessage(...$args);
|
$objMessage = new ScoutMessage(...$args);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$objMessage = new Message(...$args);
|
$objMessage = new Message(...$args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,16 +137,6 @@ class Message
|
|||||||
return $objMessage;
|
return $objMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getMessageByID(int $messageID) : Message
|
|
||||||
{
|
|
||||||
$db = DB::db();
|
|
||||||
$row = $db->queryFirstRow('SELECT * FROM `message` WHERE `id` = %i', $messageID);
|
|
||||||
if (!$row) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return static::buildFromArray($row);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static function isValidMailBox(int $mailbox): bool
|
protected static function isValidMailBox(int $mailbox): bool
|
||||||
{
|
{
|
||||||
if ($mailbox > self::MAILBOX_PUBLIC) {
|
if ($mailbox > self::MAILBOX_PUBLIC) {
|
||||||
@@ -174,6 +162,16 @@ class Message
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getMessageByID(int $messageID) : Message
|
||||||
|
{
|
||||||
|
$db = DB::db();
|
||||||
|
$row = $db->queryFirstRow('SELECT * FROM `message` WHERE `id` = %i', $messageID);
|
||||||
|
if (!$row) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return static::buildFromArray($row);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $mailbox 메일 사서함.
|
* @param int $mailbox 메일 사서함.
|
||||||
* @param string $msgType 메일 타입. MSGTYPE 중 하나.
|
* @param string $msgType 메일 타입. MSGTYPE 중 하나.
|
||||||
@@ -181,7 +179,7 @@ class Message
|
|||||||
* @param int $fromSeq 가져오고자 하는 위치. $fromSeq보다 '큰' seq만 가져온다. 따라서 0 이하이면 모두 가져옴.
|
* @param int $fromSeq 가져오고자 하는 위치. $fromSeq보다 '큰' seq만 가져온다. 따라서 0 이하이면 모두 가져옴.
|
||||||
* @return Message[]
|
* @return Message[]
|
||||||
*/
|
*/
|
||||||
protected static function getRawMessage(int $mailbox, string $msgType, int $limit=30, int $fromSeq = 0)
|
protected static function getMessagesFromMailBox(int $mailbox, string $msgType, int $limit=30, int $fromSeq = 0)
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user