Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 16 |
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('value', 'text') |
||
35 | ->addColumn('description', 'text', ['null' => true]) |
||
36 | ->addTimestamps('created', 'updated') |
||
37 | ->create(); |
||
38 | |||
39 | $data = [ |
||
40 | [ |
||
41 | 'roleId' => 2, |
||
42 | 'module' => 'options', |
||
43 | 'privilege' => 'Management' |
||
44 | ] |
||
45 | ]; |
||
46 | |||
47 | $privileges = $this->table('acl_privileges'); |
||
48 | $privileges->insert($data) |
||
49 | ->save(); |
||
50 | } |
||
51 | } |
||
52 |
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.