mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 08:41:39 +09:00
Rename $columnList to $reload_counts in getDocument()
This commit is contained in:
parent
30d7912054
commit
0ca46654aa
2 changed files with 12 additions and 19 deletions
|
|
@ -65,14 +65,13 @@ class DocumentItem extends BaseObject
|
|||
* Constructor
|
||||
* @param int $document_srl
|
||||
* @param bool $load_extra_vars
|
||||
* @param array columnList
|
||||
* @param bool $reload_counts
|
||||
* @return void
|
||||
*/
|
||||
function __construct($document_srl = 0, $load_extra_vars = true, $columnList = array())
|
||||
function __construct($document_srl = 0, $load_extra_vars = true, $reload_counts = true)
|
||||
{
|
||||
$this->document_srl = $document_srl;
|
||||
$this->columnList = $columnList;
|
||||
$this->_loadFromDB($load_extra_vars);
|
||||
$this->_loadFromDB($load_extra_vars, $reload_counts);
|
||||
}
|
||||
|
||||
function setDocument($document_srl, $load_extra_vars = true)
|
||||
|
|
@ -86,23 +85,13 @@ class DocumentItem extends BaseObject
|
|||
* @param bool $load_extra_vars
|
||||
* @return void
|
||||
*/
|
||||
function _loadFromDB($load_extra_vars = true)
|
||||
function _loadFromDB($load_extra_vars = true, $reload_counts = true)
|
||||
{
|
||||
if(!$this->document_srl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$document_item = false;
|
||||
$columnList = array();
|
||||
$reload_counts = true;
|
||||
|
||||
if ($this->columnList === false)
|
||||
{
|
||||
$reload_counts = false;
|
||||
}
|
||||
$this->columnList = array();
|
||||
|
||||
// cache controll
|
||||
$cache_key = 'document_item:' . getNumberingPath($this->document_srl) . $this->document_srl;
|
||||
$document_item = Rhymix\Framework\Cache::get($cache_key);
|
||||
|
|
@ -110,8 +99,12 @@ class DocumentItem extends BaseObject
|
|||
{
|
||||
$columnList = array('readed_count', 'voted_count', 'blamed_count', 'comment_count', 'trackback_count');
|
||||
}
|
||||
else
|
||||
{
|
||||
$columnList = [];
|
||||
}
|
||||
|
||||
if(!$document_item || $reload_counts)
|
||||
if(!$document_item || $reload_counts !== false)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $this->document_srl;
|
||||
|
|
|
|||
|
|
@ -149,10 +149,10 @@ class DocumentModel extends Document
|
|||
* @param int $document_srl
|
||||
* @param bool $is_admin
|
||||
* @param bool $load_extra_vars
|
||||
* @param array $columnList
|
||||
* @param bool $reload_counts
|
||||
* @return documentItem
|
||||
*/
|
||||
public static function getDocument($document_srl = 0, $is_admin = false, $load_extra_vars = true, $columnList = array())
|
||||
public static function getDocument($document_srl = 0, $is_admin = false, $load_extra_vars = true, $reload_counts = true)
|
||||
{
|
||||
if(!$document_srl)
|
||||
{
|
||||
|
|
@ -160,7 +160,7 @@ class DocumentModel extends Document
|
|||
}
|
||||
if(!isset($GLOBALS['XE_DOCUMENT_LIST'][$document_srl]))
|
||||
{
|
||||
$oDocument = new documentItem($document_srl, $load_extra_vars, $columnList);
|
||||
$oDocument = new documentItem($document_srl, $load_extra_vars, $reload_counts);
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
return $oDocument;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue