Store comment sorting direction in user metadata

This commit is contained in:
Frederic Guillot
2016-08-21 20:36:16 -04:00
parent 8e83e404fb
commit 1d16a53c48
13 changed files with 304 additions and 73 deletions

View File

@@ -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

View File

@@ -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
*

View 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);
}

View File

@@ -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;
}
}