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 --- app/Model/ColumnMoveRestrictionModel.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'app/Model') diff --git a/app/Model/ColumnMoveRestrictionModel.php b/app/Model/ColumnMoveRestrictionModel.php index fa44edd1..63e739bf 100644 --- a/app/Model/ColumnMoveRestrictionModel.php +++ b/app/Model/ColumnMoveRestrictionModel.php @@ -42,7 +42,8 @@ class ColumnMoveRestrictionModel extends Base */ public function getAll($project_id) { - return $this->db->table(self::TABLE) + return $this->db + ->table(self::TABLE) ->columns( 'restriction_id', 'src_column_id', @@ -58,6 +59,20 @@ class ColumnMoveRestrictionModel extends Base ->findAll(); } + /** + * Get all source column Ids + * + * @param int $project_id + * @return array + */ + public function getAllSrcColumns($project_id) + { + return $this->db + ->hashtable(self::TABLE) + ->eq(self::TABLE.'.project_id', $project_id) + ->getAll('src_column_id', 'src_column_id'); + } + /** * Create a new column restriction * -- cgit v1.2.3