등용장 구현을 위한 ScoutMessage 클래스 완성

This commit is contained in:
2018-04-14 15:37:52 +09:00
parent b92a95cc07
commit a88982940b
4 changed files with 380 additions and 22 deletions
+16 -1
View File
@@ -245,7 +245,7 @@ class Message
if($this->sendCnt > 0){
throw new \RuntimeException('이미 전송한 메일입니다.');
}
if($this->msgType === self::MSGTYPE_PRIVATE){
if($this->msgType === self::MSGTYPE_PRIVATE && $this->src->generalID !== $this->dest->generalID){
return $this->sendRaw($this->src->generalID);
}
if($this->msgType === self::MSGTYPE_NATIONAL && $this->src->nationID !== $this->dest->nationID){
@@ -295,4 +295,19 @@ class Message
return $receiveID;
}
public function invalidate(array $newMsgOption=null){
if($newMsgOption !== null){
$this->msgOption = $newMsgOption;
}
$this->validUntil = new \DateTime('2000-12-31');
$db = DB::db();
$db->update('message', [
'msgOption'=>Json::encode($this->msgOption),
'validUntil'=>$this->validUntil->format('Y-m-d H:i:s'),
]);
}
}