Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
47 | public function safeDown() |
||
48 | { |
||
49 | $query = Field::find(); |
||
50 | $query->andWhere(['type' => Domains::class]); |
||
51 | |||
52 | $success = true; |
||
53 | |||
54 | /** @var Field $record */ |
||
55 | foreach ($query->all() as $record) { |
||
56 | $record->type = static::OLD_CLASS; |
||
57 | |||
58 | if (!$record->save(true, ['type'])) { |
||
59 | $success = false; |
||
60 | } |
||
61 | } |
||
62 | |||
63 | return $success; |
||
64 | } |
||
65 | } |
||
66 |