summaryrefslogtreecommitdiff
path: root/app/Api/Swimlane.php
blob: 13838d7728f3133a10fd3393f90917482e9c6c67 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php

namespace Api;

/**
 * Swimlane API controller
 *
 * @package  api
 * @author   Frederic Guillot
 */
class Swimlane extends \Core\Base
{
    public function getActiveSwimlanes($project_id)
    {
        return $this->swimlane->getSwimlanes($project_id);
    }

    public function getAllSwimlanes($project_id)
    {
        return $this->swimlane->getAll($project_id);
    }

    public function getSwimlaneById($swimlane_id)
    {
        return $this->swimlane->getById($swimlane_id);
    }

    public function getSwimlaneByName($project_id, $name)
    {
        return $this->swimlane->getByName($project_id, $name);
    }

    public function getSwimlane($swimlane_id)
    {
        return $this->swimlane->getById($swimlane_id);
    }

    public function getDefaultSwimlane($project_id)
    {
        return $this->swimlane->getDefault($project_id);
    }

    public function addSwimlane($project_id, $name, $description = '')
    {
        return $this->swimlane->create(array('project_id' => $project_id, 'name' => $name, 'description' => $description));
    }

    public function updateSwimlane($swimlane_id, $name, $description = null)
    {
        $values = array('id' => $swimlane_id, 'name' => $name);
        if (!is_null($description)) {
            $values['description'] = $description;
        }
        return $this->swimlane->update($values);
    }

    public function removeSwimlane($project_id, $swimlane_id)
    {
        return $this->swimlane->remove($project_id, $swimlane_id);
    }

    public function disableSwimlane($project_id, $swimlane_id)
    {
        return $this->swimlane->disable($project_id, $swimlane_id);
    }

    public function enableSwimlane($project_id, $swimlane_id)
    {
        return $this->swimlane->enable($project_id, $swimlane_id);
    }

    public function moveSwimlaneUp($project_id, $swimlane_id)
    {
        return $this->swimlane->moveUp($project_id, $swimlane_id);
    }

    public function moveSwimlaneDown($project_id, $swimlane_id)
    {
        return $this->swimlane->moveDown($project_id, $swimlane_id);
    }
}