mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Add getStatus() and getStatusText() methods to document and comment for easy management
This commit is contained in:
parent
4a34b3dfa8
commit
76f3376670
8 changed files with 105 additions and 6 deletions
|
|
@ -1308,10 +1308,34 @@ class documentItem extends BaseObject
|
|||
return $buffs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the status code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getStatus()
|
||||
{
|
||||
if(!$this->get('status')) return getClass('document')->getDefaultStatus();
|
||||
return $this->get('status');
|
||||
$status = $this->get('status');
|
||||
return $status ?: Document::getDefaultStatus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the status in human-readable text.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getStatusText()
|
||||
{
|
||||
$status = $this->get('status');
|
||||
$statusList = lang('document.status_name_list');
|
||||
if ($status && isset($statusList[$status]))
|
||||
{
|
||||
return $statusList[$status];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $statusList[Document::getDefaultStatus()];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue