summaryrefslogtreecommitdiff
path: root/plugins/InternalID/Model
diff options
context:
space:
mode:
authorDzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl>2020-01-15 16:07:19 +0100
committerDzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl>2020-01-15 16:07:19 +0100
commit95e7b1498f2c178383699f8d30208cc326b7a37b (patch)
treecc1fae78a1a807fcfce8d6539d373afd670f484d /plugins/InternalID/Model
parentb6f34622b169652c57e7cabd8d11e28605f110c3 (diff)
Displaying internal project ID for tasks
Diffstat (limited to 'plugins/InternalID/Model')
-rw-r--r--plugins/InternalID/Model/InternalTaskIDModel.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/plugins/InternalID/Model/InternalTaskIDModel.php b/plugins/InternalID/Model/InternalTaskIDModel.php
new file mode 100644
index 00000000..55a68192
--- /dev/null
+++ b/plugins/InternalID/Model/InternalTaskIDModel.php
@@ -0,0 +1,58 @@
+<?php
+
+namespace Kanboard\Plugin\InternalID\Model;
+
+use Kanboard\Core\Base;
+
+/**
+ * Internal Task ID Model
+ *
+ * @package InternalID\Model
+ * @author mkl
+ */
+class InternalTaskIDModel extends Base
+{
+ /**
+ * Table name
+ *
+ * @var string
+ */
+ const TABLE = 'internal_task_id';
+
+ /**
+ * Get the table
+ *
+ * @abstract
+ * @access protected
+ * @return string
+ */
+ public function getTable()
+ {
+ return self::TABLE;
+ }
+
+ /**
+ * Define the path prefix
+ *
+ * @abstract
+ * @access protected
+ * @return string
+ */
+ public function getPathPrefix()
+ {
+ return 'internalid';
+ }
+
+ /**
+ * Get by the Task ID
+ *
+ * @access public
+ * @param integer $task_id Task ID (global)
+ * @return array
+ */
+ public function getById($task_id)
+ {
+ return $this->db->table($this->getTable())->eq('id', $task_id)->findOne();
+ }
+
+}