summaryrefslogtreecommitdiff
path: root/plugins/Group_assign/Model/OldMetaMagikSubquery.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Group_assign/Model/OldMetaMagikSubquery.php')
-rw-r--r--plugins/Group_assign/Model/OldMetaMagikSubquery.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/Group_assign/Model/OldMetaMagikSubquery.php b/plugins/Group_assign/Model/OldMetaMagikSubquery.php
new file mode 100644
index 00000000..787b7e4a
--- /dev/null
+++ b/plugins/Group_assign/Model/OldMetaMagikSubquery.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace Kanboard\Plugin\Group_assign\Model;
+
+use Kanboard\Plugin\Group_assign\Model\OldTaskFinderModel;
+
+/**
+ * New Task Finder model
+ * Extends Group_assign Model
+ *
+ * @package Kanboard\Plugin\Group_assign\Model
+ */
+class OldMetaMagikSubQuery extends OldTaskFinderModel
+{
+ 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