| Conditions | 1 |
| Paths | 1 |
| Total Lines | 31 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 7 | public function up() |
||
| 8 | { |
||
| 9 | |||
| 10 | $this->createTable( |
||
| 11 | '{{%content_block_group%}}', |
||
| 12 | [ |
||
| 13 | 'id' => $this->primaryKey(), |
||
| 14 | 'parent_id' => $this->integer(10)->notNull()->defaultValue(1), |
||
| 15 | 'name' => $this->string(250)->notNull(), |
||
| 16 | 'sort_order' => $this->integer()->notNull()->defaultValue(0) |
||
| 17 | ] |
||
| 18 | ); |
||
| 19 | |||
| 20 | $this->insert( |
||
| 21 | '{{%content_block_group%}}', |
||
| 22 | [ |
||
| 23 | 'parent_id' => 0, |
||
| 24 | 'name' => 'root', |
||
| 25 | 'sort_order' => 0 |
||
| 26 | ] |
||
| 27 | ); |
||
| 28 | |||
| 29 | $groupID = $this->db->lastInsertID; |
||
| 30 | |||
| 31 | $this->addColumn( |
||
| 32 | '{{%content_block}}', |
||
| 33 | 'group_id', |
||
| 34 | $this->integer(2)->notNull()->defaultValue($groupID) |
||
| 35 | ); |
||
| 36 | |||
| 37 | } |
||
| 38 | |||
| 60 |
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.