@@ -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 RouteReferrersInterface )
45
+ * id to get the route for (implementing RouteReferrersReadInterface )
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 RouteReferrersInterface ) {
107
+ if ($ content instanceof RouteReferrersReadInterface ) {
108
108
$ routes = $ content ->getRoutes ();
109
109
$ contentRoute = $ this ->getRouteByLocale ($ routes , $ locale );
110
110
if ($ contentRoute ) {
@@ -117,9 +117,10 @@ protected function getBestLocaleRoute(SymfonyRoute $route, $parameters)
117
117
}
118
118
119
119
/**
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
- * content_id specified in parameters.
120
+ * Get the route based on the $name that is an object implementing
121
+ * RouteReferrersReadInterface or a content found in the content repository
122
+ * with the content_id specified in parameters that is an instance of
123
+ * RouteReferrersReadInterface.
123
124
*
124
125
* Called in generate when there is no route given in the parameters.
125
126
*
@@ -132,15 +133,15 @@ protected function getBestLocaleRoute(SymfonyRoute $route, $parameters)
132
133
*
133
134
* @param mixed $name
134
135
* @param array $parameters which should contain a content field containing
135
- * a RouteReferrersInterface object
136
+ * a RouteReferrersReadInterface object
136
137
*
137
138
* @return SymfonyRoute the route instance
138
139
*
139
140
* @throws RouteNotFoundException if no route can be determined
140
141
*/
141
142
protected function getRouteByContent ($ name , &$ parameters )
142
143
{
143
- if ($ name instanceof RouteReferrersInterface ) {
144
+ if ($ name instanceof RouteReferrersReadInterface ) {
144
145
$ content = $ name ;
145
146
} elseif (isset ($ parameters ['content_id ' ])
146
147
&& null !== $ this ->contentRepository
@@ -149,12 +150,12 @@ protected function getRouteByContent($name, &$parameters)
149
150
if (empty ($ content )) {
150
151
throw new RouteNotFoundException ('The content repository found nothing at id ' . $ parameters ['content_id ' ]);
151
152
}
152
- if (!$ content instanceof RouteReferrersInterface ) {
153
- throw new RouteNotFoundException ('Content repository did not return a RouteReferrersInterface for id ' . $ parameters ['content_id ' ]);
153
+ if (!$ content instanceof RouteReferrersReadInterface ) {
154
+ throw new RouteNotFoundException ('Content repository did not return a RouteReferrersReadInterface instance for id ' . $ parameters ['content_id ' ]);
154
155
}
155
156
} else {
156
157
$ hint = is_object ($ name ) ? get_class ($ name ) : gettype ($ name );
157
- throw new RouteNotFoundException ("The route name argument ' $ hint' is not RouteReferrersInterface and there is no 'content_id' parameter " );
158
+ throw new RouteNotFoundException ("The route name argument ' $ hint' is not RouteReferrersReadInterface instance and there is no 'content_id' parameter " );
158
159
}
159
160
160
161
$ routes = $ content ->getRoutes ();
@@ -234,7 +235,7 @@ protected function getLocale($parameters)
234
235
*/
235
236
public function supports ($ name )
236
237
{
237
- return ! $ name || parent ::supports ($ name ) || $ name instanceof RouteReferrersInterface ;
238
+ return ! $ name || parent ::supports ($ name ) || $ name instanceof RouteReferrersReadInterface ;
238
239
}
239
240
240
241
/**
@@ -246,7 +247,7 @@ public function getRouteDebugMessage($name, array $parameters = array())
246
247
return 'Content id ' . $ parameters ['content_id ' ];
247
248
}
248
249
249
- if ($ name instanceof RouteReferrersInterface ) {
250
+ if ($ name instanceof RouteReferrersReadInterface ) {
250
251
return 'Route aware content ' . $ name ;
251
252
}
252
253
0 commit comments