| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function __construct(Table $model, CrossForeignKeys $cfk) { |
||
| 18 | $this->model = $model; |
||
| 19 | $this->cfk = $cfk; |
||
| 20 | |||
| 21 | foreach ($cfk->getMiddleTable()->getForeignKeys() as $fk) { |
||
| 22 | if ($fk->getForeignTable() != $model) { |
||
| 23 | $this->fk = $fk; |
||
| 24 | } else if ($fk->getForeignTable() == $model) { |
||
| 25 | $this->lk = $fk; |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | $this->foreign = $this->fk->getForeignTable(); |
||
| 30 | } |
||
| 31 | |||
| 75 | } |