summaryrefslogtreecommitdiff
path: root/plugins/Timetrackingeditor/Filter/SubtaskIdFilter.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Timetrackingeditor/Filter/SubtaskIdFilter.php')
-rw-r--r--plugins/Timetrackingeditor/Filter/SubtaskIdFilter.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/Timetrackingeditor/Filter/SubtaskIdFilter.php b/plugins/Timetrackingeditor/Filter/SubtaskIdFilter.php
new file mode 100644
index 00000000..79779446
--- /dev/null
+++ b/plugins/Timetrackingeditor/Filter/SubtaskIdFilter.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace Kanboard\Plugin\Timetrackingeditor\Filter;
+
+use Kanboard\Core\Filter\FilterInterface;
+use Kanboard\Filter\BaseFilter;
+use Kanboard\Model\SubtaskModel;
+
+/**
+ * Filter subtasks by id
+ *
+ * @package filter
+ * @author Thomas Stinner
+ */
+class SubtaskIdFilter extends BaseFilter implements FilterInterface
+{
+ /**
+ * Get search attribute
+ *
+ * @access public
+ * @return string[]
+ */
+ public function getAttributes()
+ {
+ return array('id');
+ }
+
+ /**
+ * Apply filter
+ *
+ * @access public
+ * @return FilterInterface
+ */
+ public function apply()
+ {
+ $this->query->eq(SubtaskModel::TABLE.'.id', $this->value);
+ return $this;
+ }
+}