summaryrefslogtreecommitdiff
path: root/plugins/InternalID/Model/InternalTaskIDModel.php
blob: 55a6819232bdb38d686545229460d6349dfbbad9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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();
    }

}