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