TaxonomyTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 13
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTerms() 0 11 1
1
<?php
2
3
namespace Jidaikobo\Kontiki\Models\Traits;
4
5
trait TaxonomyTrait
6
{
7
    public function getTerms(string $taxonomy): array
8
    {
9
        $result = $this->db->table('terms as t')
10
            ->join('term_taxonomy as tt', 't.term_id', '=', 'tt.term_id')
11
            ->select('t.*')
12
            ->distinct()
13
            ->where('tt.taxonomy', $taxonomy)
14
            ->get()
15
            ->toArray();
16
17
        return $result;
18
    }
19
}
20