@@ -42,7 +42,7 @@ public function setContentRepository(ContentRepositoryInterface $contentReposito
42
42
* @param string $name ignored
43
43
* @param array $parameters must either contain the field 'route' with a
44
44
* RouteObjectInterface or the field 'content_id' with a document
45
- * id to get the route for (implementing RouteAwareInterface )
45
+ * id to get the route for (implementing RouteReferrersInterface )
46
46
*
47
47
* @throws RouteNotFoundException If there is no such route in the database
48
48
*/
@@ -104,7 +104,7 @@ protected function getBestLocaleRoute(SymfonyRoute $route, $parameters)
104
104
$ locale = $ this ->getLocale ($ parameters );
105
105
if (! $ this ->checkLocaleRequirement ($ route , $ locale )) {
106
106
$ content = $ route ->getContent ();
107
- if ($ content instanceof RouteAwareInterface ) {
107
+ if ($ content instanceof RouteReferrersInterface ) {
108
108
$ routes = $ content ->getRoutes ();
109
109
$ contentRoute = $ this ->getRouteByLocale ($ routes , $ locale );
110
110
if ($ contentRoute ) {
@@ -117,8 +117,8 @@ protected function getBestLocaleRoute(SymfonyRoute $route, $parameters)
117
117
}
118
118
119
119
/**
120
- * Get the route based on the $name that is a RouteAwareInterface or a
121
- * RouteAwareInterface content found in the content repository with the
120
+ * Get the route based on the $name that is a RouteReferrersInterface or a
121
+ * RouteReferrersInterface content found in the content repository with the
122
122
* content_id specified in parameters.
123
123
*
124
124
* Called in generate when there is no route given in the parameters.
@@ -131,15 +131,16 @@ protected function getBestLocaleRoute(SymfonyRoute $route, $parameters)
131
131
* first route.
132
132
*
133
133
* @param mixed $name
134
- * @param array $parameters which should contain a content field containing a RouteAwareInterface object
134
+ * @param array $parameters which should contain a content field containing
135
+ * a RouteReferrersInterface object
135
136
*
136
137
* @return SymfonyRoute the route instance
137
138
*
138
139
* @throws RouteNotFoundException if no route can be determined
139
140
*/
140
141
protected function getRouteByContent ($ name , &$ parameters )
141
142
{
142
- if ($ name instanceof RouteAwareInterface ) {
143
+ if ($ name instanceof RouteReferrersInterface ) {
143
144
$ content = $ name ;
144
145
} elseif (isset ($ parameters ['content_id ' ])
145
146
&& null !== $ this ->contentRepository
@@ -148,12 +149,12 @@ protected function getRouteByContent($name, &$parameters)
148
149
if (empty ($ content )) {
149
150
throw new RouteNotFoundException ('The content repository found nothing at id ' . $ parameters ['content_id ' ]);
150
151
}
151
- if (!$ content instanceof RouteAwareInterface ) {
152
- throw new RouteNotFoundException ('Content repository did not return a RouteAwareInterface for id ' . $ parameters ['content_id ' ]);
152
+ if (!$ content instanceof RouteReferrersInterface ) {
153
+ throw new RouteNotFoundException ('Content repository did not return a RouteReferrersInterface for id ' . $ parameters ['content_id ' ]);
153
154
}
154
155
} else {
155
156
$ hint = is_object ($ name ) ? get_class ($ name ) : gettype ($ name );
156
- throw new RouteNotFoundException ("The route name argument ' $ hint' is not RouteAwareInterface and there is no 'content_id' parameter " );
157
+ throw new RouteNotFoundException ("The route name argument ' $ hint' is not RouteReferrersInterface and there is no 'content_id' parameter " );
157
158
}
158
159
159
160
$ routes = $ content ->getRoutes ();
@@ -233,7 +234,7 @@ protected function getLocale($parameters)
233
234
*/
234
235
public function supports ($ name )
235
236
{
236
- return ! $ name || parent ::supports ($ name ) || $ name instanceof RouteAwareInterface ;
237
+ return ! $ name || parent ::supports ($ name ) || $ name instanceof RouteReferrersInterface ;
237
238
}
238
239
239
240
/**
@@ -245,7 +246,7 @@ public function getRouteDebugMessage($name, array $parameters = array())
245
246
return 'Content id ' . $ parameters ['content_id ' ];
246
247
}
247
248
248
- if ($ name instanceof RouteAwareInterface ) {
249
+ if ($ name instanceof RouteReferrersInterface ) {
249
250
return 'Route aware content ' . $ name ;
250
251
}
251
252
0 commit comments