summaryrefslogtreecommitdiff
path: root/plugins/Group_assign/Model/NewMetaMagikSubquery.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Group_assign/Model/NewMetaMagikSubquery.php')
-rw-r--r--plugins/Group_assign/Model/NewMetaMagikSubquery.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/Group_assign/Model/NewMetaMagikSubquery.php b/plugins/Group_assign/Model/NewMetaMagikSubquery.php
new file mode 100644
index 00000000..4870120e
--- /dev/null
+++ b/plugins/Group_assign/Model/NewMetaMagikSubquery.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace Kanboard\Plugin\Group_assign\Model;
+
+use Kanboard\Plugin\Group_assign\Model\NewTaskFinderModel;
+
+/**
+ * New Task Finder model
+ * Extends Group_assign Model
+ *
+ * @package Kanboard\Plugin\Group_assign\Model
+ */
+class NewMetaMagikSubQuery extends NewTaskFinderModel
+{
+ const METADATA_TABLE = 'task_has_metadata';
+ /**
+ * Extended query
+ *
+ * @access public
+ * @return \PicoDb\Table
+ */
+ public function getExtendedQuery()
+ {
+ // add subquery to original Model, changing only what we want
+ return parent::getExtendedQuery()
+ ->subquery('(SELECT COUNT(*) FROM '.self::METADATA_TABLE.' WHERE task_id=tasks.id)', 'nb_metadata');
+ }
+} \ No newline at end of file