1 | <?php |
||
14 | class AnnotationDefinitionProvider implements DefinitionProviderInterface |
||
15 | { |
||
16 | /** |
||
17 | * Doctrine annotation reader |
||
18 | * |
||
19 | * @var Reader |
||
20 | */ |
||
21 | protected $reader; |
||
22 | |||
23 | /** |
||
24 | * AnnotationDefinitionProvider constructor. |
||
25 | * |
||
26 | * @param Reader $reader |
||
27 | */ |
||
28 | 2 | public function __construct(Reader $reader) |
|
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | 2 | public function getDefinition(string $class): Definition |
|
57 | |||
58 | /** |
||
59 | * Process relationship |
||
60 | * |
||
61 | * @param RelationshipAnnotation $annotation |
||
62 | * @param \ReflectionProperty $property |
||
63 | * @return Relationship |
||
64 | */ |
||
65 | 2 | protected function createRelationship(RelationshipAnnotation $annotation, \ReflectionProperty $property): Relationship |
|
84 | |||
85 | /** |
||
86 | * Handler getter of related object |
||
87 | * |
||
88 | * @param RelationshipAnnotation $annotation |
||
89 | * @param Relationship $relationship |
||
90 | */ |
||
91 | 2 | protected function handleGetter(RelationshipAnnotation $annotation, Relationship $relationship) |
|
103 | |||
104 | /** |
||
105 | * Handle identifier |
||
106 | * |
||
107 | * @param RelationshipAnnotation $annotation |
||
108 | * @param Relationship $relationship |
||
109 | */ |
||
110 | 2 | protected function handleIdentifier(RelationshipAnnotation $annotation, Relationship $relationship) |
|
124 | |||
125 | /** |
||
126 | * Resolve type of relationship |
||
127 | * |
||
128 | * @param RelationshipAnnotation $annotation |
||
129 | * @return int |
||
130 | */ |
||
131 | 2 | protected function resoleType(RelationshipAnnotation $annotation): int |
|
143 | } |