| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function safeUp() |
||
| 26 | { |
||
| 27 | $query = Field::find(); |
||
| 28 | $query->andWhere(['type' => self::OLD_CLASS]); |
||
| 29 | |||
| 30 | $success = true; |
||
| 31 | |||
| 32 | /** @var Field $record */ |
||
| 33 | foreach ($query->all() as $record) { |
||
| 34 | $record->type = Domains::class; |
||
| 35 | |||
| 36 | if (!$record->save(true, ['type'])) { |
||
| 37 | $success = false; |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | return $success; |
||
| 42 | } |
||
| 43 | |||
| 66 |