Completed
Push — master ( 02f92d...9c9507 )
by Sebastian
15:38
created

FrontUserDbRepository::getAllWithRole()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace App\Repositories\Database;
4
5
use App\Foundation\Repositories\DbRepository;
6
use App\Repositories\FrontUserRepository;
7
use App\Services\Auth\Front\Enums\UserRole;
8
use App\Services\Auth\Front\Enums\UserStatus;
9
use Illuminate\Database\Eloquent\Model;
10
use Illuminate\Support\Collection;
11
12
class FrontUserDbRepository extends DbRepository implements FrontUserRepository
13
{
14
    public function getAllWithRole(UserRole $role) : Collection
15
    {
16
        return $this->query()
17
            ->where('role', $role)
18
            ->get();
19
    }
20
21
    public function getAllWithRoleAndStatus(UserRole $role, UserStatus $status) : Collection
22
    {
23
        return $this->query()
24
            ->where('role', $role)
25
            ->where('status', $status)
26
            ->get();
27
    }
28
}
29