|
4 | 4 |
|
5 | 5 | namespace GraphQL\Doctrine\Factory\Type; |
6 | 6 |
|
7 | | -use GraphQL\Doctrine\Annotation\Exclude; |
8 | 7 | use GraphQL\Doctrine\Annotation\Filter; |
9 | 8 | use GraphQL\Doctrine\Annotation\Filters; |
10 | | - |
11 | 9 | use GraphQL\Doctrine\Definition\Operator\AbstractOperator; |
12 | 10 | use GraphQL\Doctrine\Definition\Operator\BetweenOperatorType; |
13 | 11 | use GraphQL\Doctrine\Definition\Operator\EmptyOperatorType; |
|
26 | 24 | use GraphQL\Type\Definition\LeafType; |
27 | 25 | use GraphQL\Type\Definition\Type; |
28 | 26 | use ReflectionClass; |
29 | | -use ReflectionProperty; |
30 | 27 |
|
31 | 28 | /** |
32 | 29 | * A factory to create an InputObjectType from a Doctrine entity to |
@@ -64,8 +61,7 @@ public function create(string $className, string $typeName): Type |
64 | 61 | foreach ($metadata->fieldMappings as $mapping) { |
65 | 62 |
|
66 | 63 | // Skip exclusion specified by user |
67 | | - $property = $metadata->getReflectionProperty($mapping['fieldName']); |
68 | | - if ($this->isExcluded($property)) { |
| 64 | + if ($this->isPropertyExcluded($metadata, $mapping['fieldName'])) { |
69 | 65 | continue; |
70 | 66 | } |
71 | 67 |
|
@@ -284,18 +280,4 @@ private function getOperatorFieldName(string $className): string |
284 | 280 |
|
285 | 281 | return lcfirst($name); |
286 | 282 | } |
287 | | - |
288 | | - /** |
289 | | - * Returns whether the property is excluded |
290 | | - * |
291 | | - * @param ReflectionProperty $property |
292 | | - * |
293 | | - * @return bool |
294 | | - */ |
295 | | - private function isExcluded(ReflectionProperty $property): bool |
296 | | - { |
297 | | - $exclude = $this->getAnnotationReader()->getPropertyAnnotation($property, Exclude::class); |
298 | | - |
299 | | - return $exclude !== null; |
300 | | - } |
301 | 283 | } |
0 commit comments