| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function requireDefaultRecords() |
||
| 17 | { |
||
| 18 | $groups = ContactHelper::config()->get('default_user_groups'); |
||
| 19 | |||
| 20 | foreach ($groups as $code => $title) { |
||
| 21 | if (!is_string($code) || !is_string($title)) { |
||
| 22 | continue; |
||
| 23 | } |
||
| 24 | |||
| 25 | $group = Group::create([ |
||
| 26 | 'Code' => $code, |
||
| 27 | 'Title' => $title |
||
| 28 | ]); |
||
| 29 | $group->write(); |
||
| 30 | |||
| 31 | DB::alteration_message('Created group ' . $title, 'created'); |
||
| 32 | } |
||
| 35 |