From 75470c72428c8d8f278d160369558ab31b137fb1 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 8 Sep 2016 22:33:16 -0400 Subject: Apply column restrictions to the board --- .../ColumnMoveRestrictionCacheDecorator.php | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 app/Decorator/ColumnMoveRestrictionCacheDecorator.php (limited to 'app/Decorator') diff --git a/app/Decorator/ColumnMoveRestrictionCacheDecorator.php b/app/Decorator/ColumnMoveRestrictionCacheDecorator.php new file mode 100644 index 00000000..331bdebb --- /dev/null +++ b/app/Decorator/ColumnMoveRestrictionCacheDecorator.php @@ -0,0 +1,57 @@ +cache = $cache; + $this->columnMoveRestrictionModel = $columnMoveRestrictionModel; + } + + /** + * Proxy method to get column Ids + * @param int $project_id + * @return array|mixed + */ + public function getAllSrcColumns($project_id) + { + $key = $this->cachePrefix.$project_id; + $columnIds = $this->cache->get($key); + + if ($columnIds === null) { + $columnIds = $this->columnMoveRestrictionModel->getAllSrcColumns($project_id); + $this->cache->set($key, $columnIds); + } + + return $columnIds; + } +} -- cgit v1.2.3