turntime 관련 조정중

This commit is contained in:
2019-10-05 10:52:31 +09:00
parent 01d3e6c03d
commit 969306822f
53 changed files with 156 additions and 66 deletions
+15
View File
@@ -35,6 +35,12 @@ class General implements iAction{
protected $lastTurn = null;
protected $resultTurn = null;
const TURNTIME_FULL_MS = -1;
const TURNTIME_FULL = 0;
const TURNTIME_HMS = 1;
const TURNTIME_HM = 2;
/**
* @param array $raw DB row값.
* @param null|array $city DB city 테이블의 row값
@@ -86,6 +92,15 @@ class General implements iAction{
);
}
function getTurnTime(int $short=self::TURNTIME_FULL_MS){
return [
self::TURNTIME_FULL_MS=>function($turntime){return $turntime;},
self::TURNTIME_FULL=>function($turntime){return substr($turntime, 0, 19);},
self::TURNTIME_HMS=>function($turntime){return substr($turntime, 11, 8);},
self::TURNTIME_HM=>function($turntime){return substr($turntime, 11, 5);},
][$short]($this->getVar('turntime'));
}
function deleteItem(string $itemKey='item'){
$this->setVar($itemKey, 0);
$this->itemObjs[$itemKey] = new ActionItem\None();