| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function addConstraints() |
||
| 13 | { |
||
| 14 | if (static::$constraints) { |
||
| 15 | // For belongs to relationships, which are essentially the inverse of has one |
||
| 16 | // or has many relationships, we need to actually query on the primary key |
||
| 17 | // of the related models matching on the foreign key that's on a parent. |
||
| 18 | $this->query->where($this->otherKey, '=', $this->parent->{$this->foreignKey}); |
||
| 19 | } |
||
| 20 | } |
||
| 21 | |||
| 39 |