외교 서신 메시지 파트 구현 완료

- 메시지 전송시 수신자에게만 전송 가능한 옵션 추가
- 메시지 추가 옵션으로 delete 옵션 제시.
This commit is contained in:
2018-04-15 21:40:21 +09:00
parent 7bdde2ac8a
commit 871c99a67a
3 changed files with 187 additions and 43 deletions
+14 -11
View File
@@ -241,7 +241,7 @@ class Message
return [$mailbox, $db->insertId()];
}
protected function sendToSender() : int{
private function sendToSender() : int{
if($this->sendCnt > 0){
throw new \RuntimeException('이미 전송한 메일입니다.');
}
@@ -254,7 +254,7 @@ class Message
return [0, 0];
}
protected function sendToReceiver() : int{
private function sendToReceiver() : int{
if($this->sendCnt > 1 || $this->isInboxMail){
throw new \RuntimeException('이미 전송한 메일입니다.');
}
@@ -274,17 +274,20 @@ class Message
throw new \RuntimeException('이곳에 올 수 없습니다.');
}
public function send():int{
list($senderMailbox, $sendID) = $this->sendToSender();
if($sendID){
$this->mailbox = $senderMailbox;
$this->isInboxMail = false;
$this->id = $sendID;
$this->msgOption['senderMessageID'] = $sendID;
$this->$sendCnt = 1;
public function send(bool $sendDestOnly=false):int{
if(!$sendDestOnly){
list($senderMailbox, $sendID) = $this->sendToSender();
if($sendID){
$this->mailbox = $senderMailbox;
$this->isInboxMail = false;
$this->id = $sendID;
$this->msgOption['senderMessageID'] = $sendID;
$this->$sendCnt = 1;
}
}
list($receiverMailbox, $receiveID) = $this->sendToReceiver();
if(!$receiveID){
if(!$receiveID && !$sendDestOnly){
return $sendID;
}
$this->mailbox = $receiverMailbox;