| Total Complexity | 2 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | trait TableRelations |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * Setup relation "one to one" or "one to many" |
||
| 26 | * |
||
| 27 | * @param string $key |
||
| 28 | * @param string $model |
||
| 29 | * @param string $foreign |
||
| 30 | * |
||
| 31 | * @return void |
||
| 32 | */ |
||
| 33 | public function linkTo($key, $model, $foreign): void |
||
| 34 | { |
||
| 35 | Relations::setRelation($this->model, $key, $model, $foreign); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Setup relation "many to many" |
||
| 40 | * [table1-key] [table1_key-table2-table3_key] [table3-key] |
||
| 41 | * |
||
| 42 | * @param string $model |
||
| 43 | * @param string $link |
||
| 44 | * |
||
| 45 | * @return void |
||
| 46 | */ |
||
| 47 | public function linkToMany($model, $link): void |
||
| 50 | } |
||
| 51 | } |
||
| 52 |