Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Lines | 8 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
43 | View Code Duplication | protected function findModelOrCreate($modelClass, $condition) |
|
44 | { |
||
45 | if (($model = $modelClass::findOne($condition)) !== null) { |
||
46 | return $model; |
||
47 | } else { |
||
48 | return new $modelClass($condition); |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 |