mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Add option to control updating the document's last-updated timestamp when a comment is posted
This commit is contained in:
parent
8c797aaba1
commit
d3db01aae0
7 changed files with 49 additions and 35 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue