| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class BelongsTo extends IlluminateBelongsTo |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Set the base constraints on the relation query. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function addConstraints() |
||
| 15 | { |
||
| 16 | if (static::$constraints) { |
||
| 17 | $this->query->where($this->ownerKey, '==', $this->child->{$this->foreignKey}); |
||
| 18 | } |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Set the constraints for an eager load of the relation. |
||
| 23 | * |
||
| 24 | * @param array $models |
||
| 25 | * @return void |
||
| 26 | */ |
||
| 27 | public function addEagerConstraints(array $models) |
||
| 37 | } |
||
| 38 | } |
||
| 39 |