Failed Conditions
Push — master ( faced6...c4ab7a )
by Kentaro
41:53
created

Version20151124193211::up()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 33
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 33
rs 8.8571
cc 1
eloc 23
nc 1
nop 1
1
<?php
2
3
namespace DoctrineMigrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
use Eccube\Entity\AuthorityRole;
8
9
/**
10
 * Auto-generated Migration: Please modify to your needs!
11
 */
12
class Version20151124193211 extends AbstractMigration
13
{
14
15
    const NAME = 'dtb_authority_role';
16
17
    /**
18
     * @param Schema $schema
19
     */
20
    public function up(Schema $schema)
21
    {
22
        // this up() migration is auto-generated, please modify it to your needs
23
24
        // AuthorityRoleを追加
25
        $app = new \Eccube\Application();
26
        $app->initialize();
27
        $app->boot();
28
        $em = $app['orm.em'];
29
30
        $Member = $app['eccube.repository.member']->find(2);
31
        $Authority = $app['eccube.repository.master.authority']->find(1);
32
33
        $AuthorityRole = new AuthorityRole();
34
        $AuthorityRole->setAuthority($Authority);
35
        $AuthorityRole->setDenyUrl('/setting/system');
36
        $AuthorityRole->setCreator($Member);
37
        $em->persist($AuthorityRole);
38
39
        $AuthorityRole = new AuthorityRole();
40
        $AuthorityRole->setAuthority($Authority);
41
        $AuthorityRole->setDenyUrl('/store');
42
        $AuthorityRole->setCreator($Member);
43
        $em->persist($AuthorityRole);
44
45
        $AuthorityRole = new AuthorityRole();
46
        $AuthorityRole->setAuthority($Authority);
47
        $AuthorityRole->setDenyUrl('/content/file_manager');
48
        $AuthorityRole->setCreator($Member);
49
        $em->persist($AuthorityRole);
50
51
        $em->flush();
52
    }
53
54
    /**
55
     * @param Schema $schema
56
     */
57
    public function down(Schema $schema)
58
    {
59
        // this down() migration is auto-generated, please modify it to your needs
60
61
    }
62
}
63