Completed
Push — master ( 049574...55da9b )
by Anton
04:39 queued 04:36
created

CategoriesPermissions   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 28
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @copyright Bluz PHP Team
4
 * @link https://github.com/bluzphp/skeleton
5
 */
6
7
use Phinx\Migration\AbstractMigration;
8
9
/**
10
 * CreateCategoriesTable
11
 */
12
class CategoriesPermissions 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...
13
{
14
    /**
15
     * Migrate Up.
16
     */
17
    public function up()
18
    {
19
        $data = [
20
            [
21
                'roleId' => 2,
22
                'module' => 'categories',
23
                'privilege' => 'Management'
24
            ]
25
        ];
26
27
        $privileges = $this->table('acl_privileges');
28
        $privileges->insert($data)
29
            ->save();
30
    }
31
32
    /**
33
     * Migrate Down.
34
     */
35
    public function down()
36
    {
37
        $this->execute('DELETE FROM acl_privileges WHERE module = "categories"');
38
    }
39
}
40