Completed
Push — master ( 5247c6...b8f763 )
by Craig
10:35 queued 03:41
created

RoutesModuleInstaller   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A upgrade() 0 21 4
1
<?php
2
/**
3
 * Routes.
4
 *
5
 * @copyright Zikula contributors (Zikula)
6
 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
7
 * @author Zikula contributors <[email protected]>.
8
 * @link http://www.zikula.org
9
 * @link http://zikula.org
10
 * @version Generated by ModuleStudio 0.7.1 (http://modulestudio.de).
11
 */
12
13
namespace Zikula\RoutesModule;
14
15
use Zikula\RoutesModule\Base\AbstractRoutesModuleInstaller;
16
17
/**
18
 * Installer implementation class.
19
 */
20
class RoutesModuleInstaller extends AbstractRoutesModuleInstaller
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function upgrade($oldVersion)
26
    {
27
        switch ($oldVersion) {
28
            case '1.0.0':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
29
                // routes of system modules are not stored in database anymore
30
                $sql = '
31
                    DELETE FROM zikula_routes_route
32
                    WHERE userRoute = 0
33
                ';
34
                $this->entityManager->getConnection()->exec($sql);
35
36
                // update table to meet entity structure
37
                $this->schemaTool->update(['\Zikula\RoutesModule\Entity\RouteEntity']);
38
            case '1.0.1':
39
                // nothing
40
            case '1.1.0':
41
                // current version
42
        }
43
44
        return true;
45
    }
46
}
47