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

FrontUserDbRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAllWithRole() 0 6 1
A getAllWithRoleAndStatus() 0 7 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