Completed
Push — master ( 4e87ef...8336f7 )
by Anton
01:40
created

OptionsPermissions::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
4
5
class OptionsPermissions 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
                'roleId' => 2,
15
                'module' => 'options',
16
                'privilege' => 'Management'
17
            ],
18
            [
19
                'roleId' => 2,
20
                'module' => 'api',
21
                'privilege' => 'Options/Read'
22
            ],
23
            [
24
                'roleId' => 2,
25
                'module' => 'api',
26
                'privilege' => 'Options/Edit'
27
            ],
28
        ];
29
30
        $privileges = $this->table('acl_privileges');
31
        $privileges->insert($data)
32
            ->save();
33
    }
34
35
    /**
36
     * Migrate Down.
37
     */
38
    public function down()
39
    {
40
        $this->execute('DELETE FROM acl_privileges WHERE module = "options"');
41
    }
42
}
43