Total Complexity | 6 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 76.47% |
Changes | 0 |
1 | <?php |
||
12 | trait HasPivotTable |
||
13 | { |
||
14 | use HasPivotForeignKey; |
||
15 | use HasPivotPrimaryKey; |
||
16 | |||
17 | /** |
||
18 | * @param $params |
||
19 | */ |
||
20 | public function addPivotParams($params) |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @return Connection |
||
28 | */ |
||
29 | 1 | public function getDB() |
|
30 | { |
||
31 | 1 | return $this->getParam("link-db") == 'with' ? $this->getWith()->getDB() : parent::getDB(); |
|
|
|||
32 | } |
||
33 | |||
34 | /** @noinspection PhpMissingParentCallCommonInspection |
||
35 | * @return string |
||
36 | */ |
||
37 | 2 | public function generateTable() |
|
38 | { |
||
39 | 2 | return $this->generatePivotTable(); |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * Builds the name of a has-and-belongs-to-many association table |
||
44 | * @return string |
||
45 | */ |
||
46 | 1 | public function generatePivotTable() |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * @param SelectQuery $query |
||
59 | */ |
||
60 | 1 | protected function hydrateQueryWithPivotConstraints($query) |
|
65 | 1 | } |
|
66 | } |
||
67 |