Passed
Push — master ( f762ef...190e8a )
by Julito
09:11
created

Version20160701110000   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 4 1
A up() 0 5 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Migrations\Schema\V111;
5
6
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\DBAL\Types\Type;
9
10
/**
11
 * Class Version20160701110000
12
 * Add option to remove splash screen on course creation
13
 * @package Chamilo\CoreBundle\Migrations\Schema\V111
14
 */
15
class Version20160701110000 extends AbstractMigrationChamilo
16
{
17
    /**
18
     * @param Schema $schema
19
     * @throws \Doctrine\DBAL\DBALException
20
     * @throws \Doctrine\DBAL\Schema\SchemaException
21
     */
22
    public function up(Schema $schema)
23
    {
24
        $this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('course_creation_splash_screen',NULL,'radio','Course','true','CourseCreationSplashScreenTitle','CourseCreationSplashScreenComment','',NULL, 1)");
25
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('course_creation_splash_screen','true','Yes') ");
26
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('course_creation_splash_screen','false','No') ");
27
    }
28
29
    /**
30
     * @param Schema $schema
31
     * @throws \Doctrine\DBAL\DBALException
32
     * @throws \Doctrine\DBAL\Schema\SchemaException
33
     */
34
    public function down(Schema $schema)
35
    {
36
        $this->addSql("DELETE FROM settings_current WHERE variable = 'course_creation_splash_screen'");
37
        $this->addSql("DELETE FROM settings_options WHERE variable = 'course_creation_splash_screen'");
38
    }
39
}
40