Failed Conditions
Push — master ( 660616...b19e2b )
by Kentaro
48:07
created

Version20170225120000::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 4
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DoctrineMigrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
use Doctrine\ORM\EntityManager;
8
use Eccube\Entity\PageLayout;
9
10 View Code Duplication
class Version20170225120000 extends AbstractMigration
0 ignored issues
show
Duplication introduced by
This class 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...
introduced by
Missing class doc comment
Loading history...
11
{
12
13
    /**
14
     * @param Schema $schema
15
     */
16
    public function up(Schema $schema)
17
    {
18
        $app = \Eccube\Application::getInstance();
19
        /** @var EntityManager $em */
20
        $em = $app["orm.em"];
21
22
        $DeviceType = $app['eccube.repository.master.device_type']->find(10);
23
24
        $PageLayout = new PageLayout();
25
        $PageLayout
26
            ->setDeviceType($DeviceType)
27
            ->setName('商品購入/確認')
28
            ->setUrl('shopping_confirm')
29
            ->setFileName('Shopping/confirm')
30
            ->setEditFlg(2)
31
            ->setMetaRobots('noindex');
32
        $em->persist($PageLayout);
33
34
        $em->flush();
35
    }
36
37
    /**
38
     * @param Schema $schema
39
     */
40
    public function down(Schema $schema)
41
    {
42
43
    }
44
}
45