ClientAddressRepository   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A selectOneByClientIdAndId() 0 3 1
A selectAllByClientId() 0 3 1
1
<?php 
2
3
namespace Hideyo\Ecommerce\Framework\Services\Client\Entity;
4
 
5
use Hideyo\Ecommerce\Framework\Services\Client\Entity\ClientAddress;
6
use Hideyo\Ecommerce\Framework\Services\BaseRepository;
7
 
8
class ClientAddressRepository extends BaseRepository
9
{
10
11
    protected $model;
12
13
    public function __construct(ClientAddress $model)
14
    {
15
        $this->model = $model;
16
    }
17
  
18
    public function selectAllByClientId($clientId)
19
    {
20
         return $this->model->where('client_id', '=', $clientId)->get();
21
    }
22
23
    public function selectOneByClientIdAndId($clientId, $id)
24
    {
25
        return $this->model->where('client_id', $clientId)->where('id', $id)->get()->first();
26
    }
27
}