Completed
Pull Request — master (#280)
by Anton
14:41
created

PagesSeeder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 18 1
1
<?php
2
3
use Phinx\Seed\AbstractSeed;
4
5
class PagesSeeder extends AbstractSeed
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
     * Run Method.
9
     *
10
     * Write your database seeder using this method.
11
     *
12
     * More information on writing seeders is available here:
13
     * http://docs.phinx.org/en/latest/seeding.html
14
     */
15
    public function run()
16
    {
17
        $data = [
18
            [
19
                'title' => 'About Bluz Framework',
20
                'alias' => 'about',
21
                'content' => '<p>Bluz Lightweight PHP Framework!</p>',
22
                'keywords' => 'php, php framework, bluz framework',
23
                'description' => 'About Bluz',
24
                'created' => date('Y-m-d H:i:s'),
25
                'userId' => 1
26
            ]
27
        ];
28
29
        $pages = $this->table('pages');
30
        $pages->insert($data)
31
            ->save();
32
    }
33
}
34