Conditions | 4 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function scopeByLang($query, $langcode = null) |
||
23 | { |
||
24 | $langcode = $langcode ?: App::getLocale(); |
||
25 | |||
26 | if (is_array($langcode) && count($langcode)) { |
||
27 | return $query->whereIn($this->getLangcodeColumn(), $langcode) |
||
28 | ->orWhereNull($this->getLangcodeColumn()); |
||
29 | } |
||
30 | |||
31 | $query->where($this->getLangcodeColumn(), $langcode) |
||
32 | ->orWhereNull($this->getLangcodeColumn()); |
||
33 | } |
||
34 | } |