Completed
Push — master ( 6daf10...1140ad )
by Anton
13s
created

DefaultPages::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nc 1
nop 0
dl 0
loc 18
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class DefaultPages extends AbstractMigration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    /**
8
     * Migrate Up.
9
     */
10
    public function up()
11
    {
12
        $data = [
13
            [
14
                'title' => 'About Bluz Framework',
15
                'alias' => 'about',
16
                'content' => '<p>Bluz Lightweight PHP Framework!</p>',
17
                'keywords' => 'php, php framework, bluz framework',
18
                'description' => 'About Bluz',
19
                'created' => date('Y-m-d H:i:s'),
20
                'userId' => 1
21
            ]
22
        ];
23
24
        $pages = $this->table('pages');
25
        $pages->insert($data)
26
            ->save();
27
    }
28
29
    /**
30
     * Migrate Down.
31
     */
32
    public function down()
33
    {
34
        $this->execute('DELETE FROM pages');
35
    }
36
}
37