File size: 575 Bytes
e4f4821 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<?php
namespace Kanboard\Helper;
use Kanboard\Core\Base;
use Kanboard\Model\UserMetadataModel;
/**
* Class CommentHelper
*
* @package Kanboard\Helper
* @author Frederic Guillot
*/
class CommentHelper extends Base
{
public function toggleSorting()
{
$oldDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');
$newDirection = $oldDirection === 'ASC' ? 'DESC' : 'ASC';
$this->userMetadataCacheDecorator->set(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, $newDirection);
}
}
|