Conditions | 4 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | protected function resolveFieldName(MetadataInterface $metadata, array $criteria): string |
||
25 | { |
||
26 | $fieldName = parent::resolveFieldName($metadata, $criteria); |
||
27 | |||
28 | if ($metadata->hasAssociation($fieldName)) { |
||
29 | $associationType = $metadata->getAssociationMapping($fieldName)['type'] ?? null; |
||
30 | |||
31 | if (null !== $associationType && !($associationType & ClassMetadataInfo::TO_ONE)) { |
||
32 | return $fieldName; |
||
33 | } |
||
34 | } |
||
35 | |||
36 | throw new InvalidArgumentException( |
||
37 | sprintf( |
||
38 | 'Unable to apply query filter \'%s\': ' |
||
39 | . 'The field \'%s\' is not a valid collection valued association', |
||
40 | self::class, |
||
41 | $fieldName, |
||
42 | ), |
||
46 |