Passed
Push — master ( c54910...c3bdb3 )
by Adam
16:46
created

CampaignRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A model() 0 3 1
A campaigns() 0 8 1
1
<?php
2
3
namespace Coyote\Repositories\Eloquent;
4
5
use Coyote\Campaign;
6
use Coyote\Repositories\Contracts\CampaignRepositoryInterface;
7
8
class CampaignRepository extends Repository implements CampaignRepositoryInterface
9
{
10
    /**
11
     * @return string
12
     */
13
    public function model()
14
    {
15
        return Campaign::class;
16
    }
17
18
    public function campaigns()
19
    {
20
        return $this
21
            ->model
22
            ->select()
23
            ->where('is_enabled', true)
24
            ->with('banners')
25
            ->get();
26
    }
27
}
28