| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 1 | public function requireDefaultRecords() |
|
| 23 | { |
||
| 24 | 1 | parent::requireDefaultRecords(); |
|
| 25 | |||
| 26 | // Add default general group if doesn't exists |
||
| 27 | 1 | $allGroups = Group::get()->filter('Title', 'general'); |
|
| 28 | 1 | if ($allGroups->count() == 0) { |
|
| 29 | 1 | $authorGroup = new Group(); |
|
| 30 | 1 | $authorGroup->Code = 'general'; |
|
| 31 | 1 | $authorGroup->Title = _t(__CLASS__ . '.DefaultGroupTitleGeneral', 'General'); |
|
| 32 | 1 | $authorGroup->Sort = 1; |
|
| 33 | 1 | $authorGroup->write(); |
|
| 34 | } |
||
| 37 |