Store comment sorting direction in user metadata
This commit is contained in:
@@ -56,6 +56,7 @@ use Pimple\Container;
|
||||
* @property \Kanboard\Core\Helper $helper
|
||||
* @property \Kanboard\Core\Paginator $paginator
|
||||
* @property \Kanboard\Core\Template $template
|
||||
* @property \Kanboard\Decorator\MetadataCacheDecorator $userMetadataCacheDecorator
|
||||
* @property \Kanboard\Model\ActionModel $actionModel
|
||||
* @property \Kanboard\Model\ActionParameterModel $actionParameterModel
|
||||
* @property \Kanboard\Model\AvatarFileModel $avatarFileModel
|
||||
|
||||
@@ -8,41 +8,8 @@ namespace Kanboard\Core\Cache;
|
||||
* @package Kanboard\Core\Cache
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
abstract class BaseCache
|
||||
abstract class BaseCache implements CacheInterface
|
||||
{
|
||||
/**
|
||||
* Store an item in the cache
|
||||
*
|
||||
* @access public
|
||||
* @param string $key
|
||||
* @param string $value
|
||||
*/
|
||||
abstract public function set($key, $value);
|
||||
|
||||
/**
|
||||
* Retrieve an item from the cache by key
|
||||
*
|
||||
* @access public
|
||||
* @param string $key
|
||||
* @return mixed Null when not found, cached value otherwise
|
||||
*/
|
||||
abstract public function get($key);
|
||||
|
||||
/**
|
||||
* Remove all items from the cache
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
abstract public function flush();
|
||||
|
||||
/**
|
||||
* Remove an item from the cache
|
||||
*
|
||||
* @access public
|
||||
* @param string $key
|
||||
*/
|
||||
abstract public function remove($key);
|
||||
|
||||
/**
|
||||
* Proxy cache
|
||||
*
|
||||
|
||||
45
app/Core/Cache/CacheInterface.php
Normal file
45
app/Core/Cache/CacheInterface.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Core\Cache;
|
||||
|
||||
/**
|
||||
* Interface CacheInterface
|
||||
*
|
||||
* @package Kanboard\Core\Cache
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
interface CacheInterface
|
||||
{
|
||||
/**
|
||||
* Store an item in the cache
|
||||
*
|
||||
* @access public
|
||||
* @param string $key
|
||||
* @param string $value
|
||||
*/
|
||||
public function set($key, $value);
|
||||
|
||||
/**
|
||||
* Retrieve an item from the cache by key
|
||||
*
|
||||
* @access public
|
||||
* @param string $key
|
||||
* @return mixed Null when not found, cached value otherwise
|
||||
*/
|
||||
public function get($key);
|
||||
|
||||
/**
|
||||
* Remove all items from the cache
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function flush();
|
||||
|
||||
/**
|
||||
* Remove an item from the cache
|
||||
*
|
||||
* @access public
|
||||
* @param string $key
|
||||
*/
|
||||
public function remove($key);
|
||||
}
|
||||
@@ -203,26 +203,4 @@ class UserSession extends Base
|
||||
{
|
||||
$this->sessionStorage->boardCollapsed[$project_id] = $is_collapsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set comments sorting
|
||||
*
|
||||
* @access public
|
||||
* @param string $order
|
||||
*/
|
||||
public function setCommentSorting($order)
|
||||
{
|
||||
$this->sessionStorage->commentSorting = $order;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get comments sorting direction
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getCommentSorting()
|
||||
{
|
||||
return empty($this->sessionStorage->commentSorting) ? 'ASC' : $this->sessionStorage->commentSorting;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user