Add option to control updating the document's last-updated timestamp when a comment is posted

This commit is contained in:
Kijin Sung 2017-05-07 21:37:37 +09:00
parent 8c797aaba1
commit d3db01aae0
7 changed files with 49 additions and 35 deletions

View file

@ -1585,24 +1585,25 @@ class documentController extends document
* @param int $document_srl
* @param int $comment_count
* @param string $last_updater
* @param bool $comment_inserted
* @param bool $update_order
* @return object
*/
function updateCommentCount($document_srl, $comment_count, $last_updater, $comment_inserted = false)
function updateCommentCount($document_srl, $comment_count, $last_updater, $update_order = false)
{
$args = new stdClass();
$args->document_srl = $document_srl;
$args->comment_count = $comment_count;
if($comment_inserted)
if($update_order)
{
$args->update_order = -1*getNextSequence();
$args->last_update = date('YmdHis');
$args->last_updater = $last_updater;
// remove document item from cache
Rhymix\Framework\Cache::delete('document_item:' . getNumberingPath($document_srl) . $document_srl);
}
// remove document item from cache
Rhymix\Framework\Cache::delete('document_item:' . getNumberingPath($document_srl) . $document_srl);
return executeQuery('document.updateCommentCount', $args);
}