Failed Conditions
Pull Request — master (#1697)
by Ryo
169:53 queued 160:14
created

Version20160725110400::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 1
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\PageLayout;
8
/**
9
 * Auto-generated Migration: Please modify to your needs!
10
 */
11
class Version20160725110400 extends AbstractMigration
12
{
13
    /**
14
     * @param Schema $schema
15
     */
16
    public function up(Schema $schema)
17
    {
18
        // this up() migration is auto-generated, please modify it to your needs
19
        $app = \Eccube\Application::getInstance();
20
        $em = $app["orm.em"];
21
22
        $DeviceType = $em->getRepository('\Eccube\Entity\Master\DeviceType')->find(\Eccube\Entity\Master\DeviceType::DEVICE_TYPE_PC);
23
        $PageLayout = new PageLayout();
24
        $PageLayout->setDeviceType($DeviceType);
25
        $PageLayout->setName('404エラーページ');
26
        $PageLayout->setUrl('404');
27
        $PageLayout->setFileName('404');
28
        $PageLayout->setEditFlg(2);
29
        $PageLayout->setMetaRobots('noindex');
30
        $PageLayout->setCreateDate(new \DateTime());
31
        $PageLayout->setUpdateDate(new \DateTime());
32
33
        $em->persist($PageLayout);
34
        $em->flush();
35
    }
36
37
    /**
38
     * @param Schema $schema
39
     */
40
    public function down(Schema $schema)
41
    {
42
        // this down() migration is auto-generated, please modify it to your needs
43
44
    }
45
}
46