SwimlaneModel   B
last analyzed

Complexity

Total Complexity 43

Size/Duplication

Total Lines 497
Duplicated Lines 9.86 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 49
loc 497
rs 8.3157
c 0
b 0
f 0
wmc 43
lcom 1
cbo 1

22 Methods

Rating   Name   Duplication   Size   Complexity  
A getById() 0 4 1
A getNameById() 0 4 2
A getIdByName() 0 7 1
A getByName() 0 7 1
A getFirstActiveSwimlane() 0 10 2
A getDefault() 0 14 2
A getAll() 0 8 1
A getAllByStatus() 0 15 2
B getSwimlanes() 0 26 3
B getList() 0 20 5
A create() 0 10 2
A update() 0 7 1
A updateDefault() 0 10 1
A enableDefault() 0 9 1
A disableDefault() 0 9 1
A getLastPosition() 0 8 1
A disable() 0 17 2
A enable() 0 10 1
A remove() 20 20 2
A updatePositions() 0 23 3
B changePosition() 29 29 5
A duplicate() 0 20 3

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complex Class

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like SwimlaneModel often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use SwimlaneModel, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
/*
4
 * This file is part of Jitamin.
5
 *
6
 * Copyright (C) Jitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Jitamin\Model;
13
14
use Jitamin\Foundation\Database\Model;
15
16
/**
17
 * Swimlanes.
18
 */
19
class SwimlaneModel extends Model
20
{
21
    /**
22
     * SQL table name.
23
     *
24
     * @var string
25
     */
26
    const TABLE = 'swimlanes';
27
28
    /**
29
     * Value for active swimlanes.
30
     *
31
     * @var int
32
     */
33
    const ACTIVE = 1;
34
35
    /**
36
     * Value for inactive swimlanes.
37
     *
38
     * @var int
39
     */
40
    const INACTIVE = 0;
41
42
    /**
43
     * Get a swimlane by the id.
44
     *
45
     * @param int $swimlane_id Swimlane id
46
     *
47
     * @return array
48
     */
49
    public function getById($swimlane_id)
50
    {
51
        return $this->db->table(self::TABLE)->eq('id', $swimlane_id)->findOne();
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
52
    }
53
54
    /**
55
     * Get the swimlane name by the id.
56
     *
57
     * @param int $swimlane_id Swimlane id
58
     *
59
     * @return string
60
     */
61
    public function getNameById($swimlane_id)
62
    {
63
        return $this->db->table(self::TABLE)->eq('id', $swimlane_id)->findOneColumn('name') ?: '';
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
64
    }
65
66
    /**
67
     * Get a swimlane id by the project and the name.
68
     *
69
     * @param int    $project_id Project id
70
     * @param string $name       Name
71
     *
72
     * @return int
73
     */
74
    public function getIdByName($project_id, $name)
75
    {
76
        return (int) $this->db->table(self::TABLE)
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
77
                        ->eq('project_id', $project_id)
78
                        ->eq('name', $name)
79
                        ->findOneColumn('id');
80
    }
81
82
    /**
83
     * Get a swimlane by the project and the name.
84
     *
85
     * @param int    $project_id Project id
86
     * @param string $name       Swimlane name
87
     *
88
     * @return array
89
     */
90
    public function getByName($project_id, $name)
91
    {
92
        return $this->db->table(self::TABLE)
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
93
                        ->eq('project_id', $project_id)
94
                        ->eq('name', $name)
95
                        ->findOne();
96
    }
97
98
    /**
99
     * Get first active swimlane for a project.
100
     *
101
     * @param int $project_id
102
     *
103
     * @return array|null
104
     */
105
    public function getFirstActiveSwimlane($project_id)
106
    {
107
        $swimlanes = $this->getSwimlanes($project_id);
108
109
        if (empty($swimlanes)) {
110
            return;
111
        }
112
113
        return $swimlanes[0];
114
    }
115
116
    /**
117
     * Get default swimlane properties.
118
     *
119
     * @param int $project_id Project id
120
     *
121
     * @return array
122
     */
123
    public function getDefault($project_id)
124
    {
125
        $result = $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
126
            ->table(ProjectModel::TABLE)
127
            ->eq('id', $project_id)
128
            ->columns('id', 'default_swimlane', 'show_default_swimlane')
129
            ->findOne();
130
131
        if ($result['default_swimlane'] === 'Default swimlane') {
132
            $result['default_swimlane'] = t($result['default_swimlane']);
133
        }
134
135
        return $result;
136
    }
137
138
    /**
139
     * Get all swimlanes for a given project.
140
     *
141
     * @param int $project_id Project id
142
     *
143
     * @return array
144
     */
145
    public function getAll($project_id)
146
    {
147
        return $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
148
            ->table(self::TABLE)
149
            ->eq('project_id', $project_id)
150
            ->orderBy('position', 'asc')
151
            ->findAll();
152
    }
153
154
    /**
155
     * Get the list of swimlanes by status.
156
     *
157
     * @param int $project_id Project id
158
     * @param int $status     Status
159
     *
160
     * @return array
161
     */
162
    public function getAllByStatus($project_id, $status = self::ACTIVE)
163
    {
164
        $query = $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
165
            ->table(self::TABLE)
166
            ->eq('project_id', $project_id)
167
            ->eq('is_active', $status);
168
169
        if ($status == self::ACTIVE) {
170
            $query->asc('position');
171
        } else {
172
            $query->asc('name');
173
        }
174
175
        return $query->findAll();
176
    }
177
178
    /**
179
     * Get active swimlanes.
180
     *
181
     * @param int $project_id Project id
182
     *
183
     * @return array
184
     */
185
    public function getSwimlanes($project_id)
186
    {
187
        $swimlanes = $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
188
            ->table(self::TABLE)
189
            ->columns('id', 'name', 'description')
190
            ->eq('project_id', $project_id)
191
            ->eq('is_active', self::ACTIVE)
192
            ->orderBy('position', 'asc')
193
            ->findAll();
194
195
        $defaultSwimlane = $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
196
            ->table(ProjectModel::TABLE)
197
            ->eq('id', $project_id)
198
            ->eq('show_default_swimlane', 1)
199
            ->findOneColumn('default_swimlane');
200
201
        if ($defaultSwimlane) {
202
            if ($defaultSwimlane === 'Default swimlane') {
203
                $defaultSwimlane = t($defaultSwimlane);
204
            }
205
206
            array_unshift($swimlanes, ['id' => 0, 'name' => $defaultSwimlane]);
207
        }
208
209
        return $swimlanes;
210
    }
211
212
    /**
213
     * Get list of all swimlanes.
214
     *
215
     * @param int  $project_id  Project id
216
     * @param bool $prepend     Prepend default value
217
     * @param bool $only_active Return only active swimlanes
218
     *
219
     * @return array
220
     */
221
    public function getList($project_id, $prepend = false, $only_active = false)
222
    {
223
        $swimlanes = [];
224
        $default = $this->db->table(ProjectModel::TABLE)->eq('id', $project_id)->eq('show_default_swimlane', 1)->findOneColumn('default_swimlane');
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
225
226
        if ($prepend) {
227
            $swimlanes[-1] = t('All swimlanes');
228
        }
229
230
        if (!empty($default)) {
231
            $swimlanes[0] = $default === 'Default swimlane' ? t($default) : $default;
232
        }
233
234
        return $swimlanes + $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
235
            ->hashtable(self::TABLE)
236
            ->eq('project_id', $project_id)
237
            ->in('is_active', $only_active ? [self::ACTIVE] : [self::ACTIVE, self::INACTIVE])
238
            ->orderBy('position', 'asc')
239
            ->getAll('id', 'name');
240
    }
241
242
    /**
243
     * Add a new swimlane.
244
     *
245
     * @param array $values Form values
246
     *
247
     * @return int|bool
248
     */
249
    public function create($values)
250
    {
251
        if (!$this->projectModel->exists($values['project_id'])) {
0 ignored issues
show
Documentation introduced by
The property projectModel does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
252
            return 0;
253
        }
254
255
        $values['position'] = $this->getLastPosition($values['project_id']);
256
257
        return $this->db->table(self::TABLE)->persist($values);
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
258
    }
259
260
    /**
261
     * Update a swimlane.
262
     *
263
     * @param array $values Form values
264
     *
265
     * @return bool
266
     */
267
    public function update(array $values)
268
    {
269
        return $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
270
            ->table(self::TABLE)
271
            ->eq('id', $values['id'])
272
            ->update($values);
273
    }
274
275
    /**
276
     * Update the default swimlane.
277
     *
278
     * @param array $values Form values
279
     *
280
     * @return bool
281
     */
282
    public function updateDefault(array $values)
283
    {
284
        return $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
285
            ->table(ProjectModel::TABLE)
286
            ->eq('id', $values['id'])
287
            ->update([
288
                'default_swimlane'      => $values['default_swimlane'],
289
                'show_default_swimlane' => $values['show_default_swimlane'],
290
            ]);
291
    }
292
293
    /**
294
     * Enable the default swimlane.
295
     *
296
     * @param int $project_id
297
     *
298
     * @return bool
299
     */
300
    public function enableDefault($project_id)
301
    {
302
        return $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
303
            ->table(ProjectModel::TABLE)
304
            ->eq('id', $project_id)
305
            ->update([
306
                'show_default_swimlane' => 1,
307
            ]);
308
    }
309
310
    /**
311
     * Disable the default swimlane.
312
     *
313
     * @param int $project_id
314
     *
315
     * @return bool
316
     */
317
    public function disableDefault($project_id)
318
    {
319
        return $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
320
            ->table(ProjectModel::TABLE)
321
            ->eq('id', $project_id)
322
            ->update([
323
                'show_default_swimlane' => 0,
324
            ]);
325
    }
326
327
    /**
328
     * Get the last position of a swimlane.
329
     *
330
     * @param int $project_id
331
     *
332
     * @return int
333
     */
334
    public function getLastPosition($project_id)
335
    {
336
        return $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
337
            ->table(self::TABLE)
338
            ->eq('project_id', $project_id)
339
            ->eq('is_active', 1)
340
            ->count() + 1;
341
    }
342
343
    /**
344
     * Disable a swimlane.
345
     *
346
     * @param int $project_id  Project id
347
     * @param int $swimlane_id Swimlane id
348
     *
349
     * @return bool
350
     */
351
    public function disable($project_id, $swimlane_id)
352
    {
353
        $result = $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
354
            ->table(self::TABLE)
355
            ->eq('id', $swimlane_id)
356
            ->update([
357
                'is_active' => self::INACTIVE,
358
                'position'  => 0,
359
            ]);
360
361
        if ($result) {
362
            // Re-order positions
363
            $this->updatePositions($project_id);
364
        }
365
366
        return $result;
367
    }
368
369
    /**
370
     * Enable a swimlane.
371
     *
372
     * @param int $project_id  Project id
373
     * @param int $swimlane_id Swimlane id
374
     *
375
     * @return bool
376
     */
377
    public function enable($project_id, $swimlane_id)
378
    {
379
        return $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
380
            ->table(self::TABLE)
381
            ->eq('id', $swimlane_id)
382
            ->update([
383
                'is_active' => self::ACTIVE,
384
                'position'  => $this->getLastPosition($project_id),
385
            ]);
386
    }
387
388
    /**
389
     * Remove a swimlane.
390
     *
391
     * @param int $project_id  Project id
392
     * @param int $swimlane_id Swimlane id
393
     *
394
     * @return bool
395
     */
396 View Code Duplication
    public function remove($project_id, $swimlane_id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
397
    {
398
        $this->db->startTransaction();
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
399
400
        // Tasks should not be assigned anymore to this swimlane
401
        $this->db->table(TaskModel::TABLE)->eq('swimlane_id', $swimlane_id)->update(['swimlane_id' => 0]);
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
402
403
        if (!$this->db->table(self::TABLE)->eq('id', $swimlane_id)->remove()) {
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
404
            $this->db->cancelTransaction();
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
405
406
            return false;
407
        }
408
409
        // Re-order positions
410
        $this->updatePositions($project_id);
411
412
        $this->db->closeTransaction();
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
413
414
        return true;
415
    }
416
417
    /**
418
     * Update swimlane positions after disabling or removing a swimlane.
419
     *
420
     * @param int $project_id Project id
421
     *
422
     * @return bool
423
     */
424
    public function updatePositions($project_id)
425
    {
426
        $position = 0;
427
        $swimlanes = $this->db
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
428
            ->table(self::TABLE)
429
            ->eq('project_id', $project_id)
430
            ->eq('is_active', 1)
431
            ->asc('position')
432
            ->asc('id')
433
            ->findAllByColumn('id');
434
435
        if (!$swimlanes) {
436
            return false;
437
        }
438
439
        foreach ($swimlanes as $swimlane_id) {
440
            $this->db->table(self::TABLE)
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
441
                ->eq('id', $swimlane_id)
442
                ->update(['position' => ++$position]);
443
        }
444
445
        return true;
446
    }
447
448
    /**
449
     * Change swimlane position.
450
     *
451
     * @param int $project_id
452
     * @param int $swimlane_id
453
     * @param int $position
454
     *
455
     * @return bool
456
     */
457 View Code Duplication
    public function changePosition($project_id, $swimlane_id, $position)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
458
    {
459
        if ($position < 1 || $position > $this->db->table(self::TABLE)->eq('project_id', $project_id)->count()) {
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
460
            return false;
461
        }
462
463
        $swimlane_ids = $this->db->table(self::TABLE)
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
464
            ->eq('is_active', 1)
465
            ->eq('project_id', $project_id)
466
            ->neq('id', $swimlane_id)
467
            ->asc('position')
468
            ->findAllByColumn('id');
469
470
        $offset = 1;
471
        $results = [];
472
473
        foreach ($swimlane_ids as $current_swimlane_id) {
474
            if ($offset == $position) {
475
                $offset++;
476
            }
477
478
            $results[] = $this->db->table(self::TABLE)->eq('id', $current_swimlane_id)->update(['position' => $offset]);
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
479
            $offset++;
480
        }
481
482
        $results[] = $this->db->table(self::TABLE)->eq('id', $swimlane_id)->update(['position' => $position]);
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
483
484
        return !in_array(false, $results, true);
485
    }
486
487
    /**
488
     * Duplicate Swimlane to project.
489
     *
490
     * @param int $project_from Project Template
491
     * @param int $project_to   Project that receives the copy
492
     *
493
     * @return int|bool
494
     */
495
    public function duplicate($project_from, $project_to)
496
    {
497
        $swimlanes = $this->getAll($project_from);
498
499
        foreach ($swimlanes as $swimlane) {
500
            unset($swimlane['id']);
501
            $swimlane['project_id'] = $project_to;
502
503
            if (!$this->db->table(self::TABLE)->save($swimlane)) {
0 ignored issues
show
Documentation introduced by
The property db does not exist on object<Jitamin\Model\SwimlaneModel>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
504
                return false;
505
            }
506
        }
507
508
        $default_swimlane = $this->getDefault($project_from);
509
        $default_swimlane['id'] = $project_to;
510
511
        $this->updateDefault($default_swimlane);
512
513
        return true;
514
    }
515
}
516