1 | <?php |
||
17 | class LinksRelation extends AbstractRelation implements RelationInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var UrlGeneratorInterface |
||
21 | */ |
||
22 | private $urlGenerator; |
||
23 | |||
24 | /** |
||
25 | * @var ObjectManagerInterface |
||
26 | */ |
||
27 | private $objectManager; |
||
28 | |||
29 | /** |
||
30 | * @var ClassMetadata |
||
31 | */ |
||
32 | private $classMetadata; |
||
33 | |||
34 | /** |
||
35 | * @var \ReflectionClass |
||
36 | */ |
||
37 | private $reflectionClass; |
||
38 | |||
39 | /** |
||
40 | * AbstractRelation constructor. |
||
41 | * |
||
42 | * @param Reader $annotationReader |
||
43 | * @param UrlGeneratorInterface $urlGenerator |
||
44 | * @param ObjectManagerInterface $objectManager |
||
45 | */ |
||
46 | public function __construct( |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function getName() |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function getRelation($resource) |
||
85 | |||
86 | /** |
||
87 | * @param \ReflectionProperty $property |
||
88 | * @param object $relationContent |
||
89 | * |
||
90 | * @return string|null |
||
91 | * |
||
92 | */ |
||
93 | private function getRelationLink(\ReflectionProperty $property, $relationContent) |
||
102 | |||
103 | /** |
||
104 | * Get the url of an entity. |
||
105 | * |
||
106 | * @param $resource |
||
107 | * |
||
108 | * @return array|null |
||
109 | */ |
||
110 | private function getSelfLink($resource) |
||
123 | |||
124 | /** |
||
125 | * Get the links of a collection. |
||
126 | * |
||
127 | * @param \ReflectionProperty $property |
||
128 | * @param $relationContent |
||
129 | * |
||
130 | * @return array|void |
||
131 | */ |
||
132 | private function getRelationLinks(\ReflectionProperty $property, $relationContent) |
||
145 | |||
146 | /** |
||
147 | * Return the configured route name for an embeddable relation. |
||
148 | * |
||
149 | * @param \ReflectionProperty $property |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | private function getAssociationRouteName(\ReflectionProperty $property) |
||
163 | |||
164 | /** |
||
165 | * Return the configured route name for a resource, or get_*entityShortName* by default. |
||
166 | * |
||
167 | * @param \ReflectionClass $resource |
||
168 | * |
||
169 | * @return string |
||
170 | */ |
||
171 | private function getResourceRouteName(\ReflectionClass $resource) |
||
179 | } |
||
180 |