Conditions | 1 |
Paths | 1 |
Total Lines | 37 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function change() |
||
37 | { |
||
38 | $table = $this->table('test'); |
||
39 | $table |
||
40 | ->addColumn('name', 'string', ['length' => 255]) |
||
41 | ->addColumn('email', 'string', ['length' => 255, 'null' => true]) |
||
42 | ->addColumn('status', 'enum', ['values' => ['active', 'disable', 'delete']]) |
||
43 | ->addTimestamps('created', 'updated') |
||
44 | ->create(); |
||
45 | |||
46 | $data = [ |
||
47 | [ |
||
48 | 'roleId' => 2, |
||
49 | 'module' => 'test', |
||
50 | 'privilege' => 'Create' |
||
51 | ], |
||
52 | [ |
||
53 | 'roleId' => 2, |
||
54 | 'module' => 'test', |
||
55 | 'privilege' => 'Read' |
||
56 | ], |
||
57 | [ |
||
58 | 'roleId' => 2, |
||
59 | 'module' => 'test', |
||
60 | 'privilege' => 'Update' |
||
61 | ], |
||
62 | [ |
||
63 | 'roleId' => 2, |
||
64 | 'module' => 'test', |
||
65 | 'privilege' => 'Delete' |
||
66 | ], |
||
67 | ]; |
||
68 | |||
69 | $privileges = $this->table('acl_privileges'); |
||
70 | $privileges->insert($data) |
||
71 | ->save(); |
||
72 | } |
||
73 | } |
||
74 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.