Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function apply(Builder $builder, Entity $entity): void |
||
23 | { |
||
24 | $eagerLoads = $builder->getEagerLoads(); |
||
25 | |||
26 | // If there is any eagerload matching the eav key, we will replace it with |
||
27 | // all the registered properties for the entity. We'll simulate as if the |
||
28 | // user has manually added all of these withs in purpose when querying. |
||
29 | if (array_key_exists('eav', $eagerLoads)) { |
||
30 | $eagerLoads = array_merge($eagerLoads, $entity->getEntityAttributeRelations()); |
||
31 | |||
32 | $builder->setEagerLoads(Arr::except($eagerLoads, 'eav')); |
||
33 | } |
||
34 | } |
||
35 | } |
||
36 |