Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function change() |
||
29 | { |
||
30 | $pages = $this->table('options', ['id' => false, 'primary_key' => ['namespace', 'key']]); |
||
31 | $pages |
||
32 | ->addColumn('namespace', 'string', ['length' => 255, 'default' => 'default']) |
||
33 | ->addColumn('key', 'string', ['length' => 255]) |
||
34 | ->addColumn('description', 'text') |
||
35 | ->addTimestamps('created', 'updated') |
||
36 | ->create(); |
||
37 | |||
38 | $data = [ |
||
39 | [ |
||
40 | 'roleId' => 2, |
||
41 | 'module' => 'options', |
||
42 | 'privilege' => 'Management' |
||
43 | ] |
||
44 | ]; |
||
45 | |||
46 | $privileges = $this->table('acl_privileges'); |
||
47 | $privileges->insert($data) |
||
48 | ->save(); |
||
49 | } |
||
50 | } |
||
51 |
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.