CitiesController::getByRegionAndProvince()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Yajra\Address\Controllers;
4
5
use Illuminate\Routing\Controller;
6
use Yajra\Address\Repositories\Cities\CitiesRepository;
7
8
class CitiesController extends Controller
9
{
10
    /**
11
     * @var CitiesRepository
12
     */
13
    protected $repository;
14
15
    /**
16
     * CitiesController constructor.
17
     *
18
     * @param CitiesRepository $repository
19
     */
20
    public function __construct(CitiesRepository $repository)
21
    {
22
        $this->repository = $repository;
23
    }
24
25
    /**
26
     * Get cities by province.
27
     *
28
     * @param string $provinceId
29
     * @return \Illuminate\Database\Eloquent\Collection
30
     */
31
    public function getByProvince($provinceId)
32
    {
33
        return $this->repository->getByProvince($provinceId);
34
    }
35
36
    /**
37
     * Get cities by region and province Id.
38
     *
39
     * @param string $regionId
40
     * @param string $provinceId
41
     * @return \Illuminate\Database\Eloquent\Collection
42
     */
43
    public function getByRegionAndProvince($regionId, $provinceId)
44
    {
45
        return $this->repository->getByProvinceAndRegion($regionId, $provinceId);
46
    }
47
}
48