Passed
Push — master ( 7828f1...cb386f )
by Iman
03:40
created

CbUsersRepo   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A where() 0 3 1
A find() 0 3 1
A updateByMail() 0 3 1
A findByMail() 0 3 1
A table() 0 3 1
1
<?php
2
3
namespace crocodicstudio\crudbooster\CBCoreModule;
4
5
class CbUsersRepo
6
{
7
    public static function find($id)
8
    {
9
        return self::where(['id' => $id])->first();
10
    }
11
12
    public static function where($conditions)
13
    {
14
        return self::table()->where($conditions);
15
    }
16
17
    public static function table()
18
    {
19
        return \DB::table(cbConfig('USER_TABLE'));
20
    }
21
22
    public static function findByMail($email)
23
    {
24
        return self::where(['email' => $email])->first();
25
    }
26
27
    public static function updateByMail($email, $data)
28
    {
29
        return self::where(['email' => $email])->update($data);
30
    }
31
}