getBarangaysByRegionProvinceCityId()   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 3
1
<?php
2
3
namespace Yajra\Address\Controllers;
4
5
use Illuminate\Routing\Controller;
6
use Yajra\Address\Repositories\Barangays\BarangaysRepository;
7
8
class BarangaysController extends Controller
9
{
10
    /**
11
     * @var BarangaysRepository
12
     */
13
    protected $repository;
14
15
    /**
16
     * BarangaysController constructor.
17
     *
18
     * @param BarangaysRepository $repository
19
     */
20
    public function __construct(BarangaysRepository $repository)
21
    {
22
        $this->repository = $repository;
23
    }
24
25
    /**
26
     * @param string $cityId
27
     * @return \Illuminate\Database\Eloquent\Collection
28
     */
29
    public function getByCity($cityId)
30
    {
31
        return $this->repository->getByCity($cityId);
32
    }
33
34
    /**
35
     * Get barangays by region, province and city ID.
36
     *
37
     * @param string $regionId
38
     * @param string $provinceId
39
     * @param string $cityId
40
     * @return string
41
     */
42
    public function getBarangaysByRegionProvinceCityId($regionId, $provinceId, $cityId)
43
    {
44
        return $this->repository->getByProvinceRegionAndCityId($regionId, $provinceId, $cityId);
45
    }
46
}
47