summaryrefslogtreecommitdiff
path: root/app/Model/TaskTagModel.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-02 14:44:26 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-02 14:44:26 -0400
commit3fcc0cb9183f9ff32ce7a3c615258bcf53c385ed (patch)
tree219a6d8270d2067a250ead4096c754ceb0eb1589 /app/Model/TaskTagModel.php
parent853189a43fff8b8b64f18029a35ac910b14932e8 (diff)
Handle tags and tasks move/duplication to another project
Diffstat (limited to 'app/Model/TaskTagModel.php')
-rw-r--r--app/Model/TaskTagModel.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/Model/TaskTagModel.php b/app/Model/TaskTagModel.php
index 2a08e867..0553cc6c 100644
--- a/app/Model/TaskTagModel.php
+++ b/app/Model/TaskTagModel.php
@@ -20,6 +20,23 @@ class TaskTagModel extends Base
const TABLE = 'task_has_tags';
/**
+ * Get all tags not available in a project
+ *
+ * @access public
+ * @param integer $task_id
+ * @param integer $project_id
+ * @return array
+ */
+ public function getTagIdsByTaskNotAvailableInProject($task_id, $project_id)
+ {
+ return $this->db->table(TagModel::TABLE)
+ ->eq(self::TABLE.'.task_id', $task_id)
+ ->notIn(TagModel::TABLE.'.project_id', array(0, $project_id))
+ ->join(self::TABLE, 'tag_id', 'id')
+ ->findAllByColumn(TagModel::TABLE.'.id');
+ }
+
+ /**
* Get all tags associated to a task
*
* @access public