| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class AddDisplaytypes extends Migration |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * Run the migrations. |
||
| 10 | * |
||
| 11 | * @return void |
||
| 12 | */ |
||
| 13 | public function up() |
||
| 14 | { |
||
| 15 | $displaytypes = [ |
||
| 16 | 'create_detail' => 'Uccello\Core\Fields\Displaytype\CreateDetail', |
||
| 17 | 'list_only' => 'Uccello\Core\Fields\Displaytype\ListOnly', |
||
| 18 | ]; |
||
| 19 | |||
| 20 | foreach ($displaytypes as $name => $class) { |
||
| 21 | $displaytype = new Displaytype(); |
||
| 22 | $displaytype->name = $name; |
||
| 23 | $displaytype->class = $class; |
||
| 24 | $displaytype->save(); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Reverse the migrations. |
||
| 30 | * |
||
| 31 | * @return void |
||
| 32 | */ |
||
| 33 | public function down() |
||
| 38 | } |
||
| 39 | } |
||
| 40 |