File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,6 @@ protected function getCandidates($url)
119
119
*/
120
120
public function getRouteByName ($ name , $ parameters = array ())
121
121
{
122
-
123
122
// $name is the route document path
124
123
if ('' === $ this ->idPrefix || 0 === strpos ($ name , $ this ->idPrefix )) {
125
124
$ route = $ this ->getObjectManager ()->find ($ this ->className , $ name );
@@ -141,18 +140,15 @@ public function getRouteByName($name, $parameters = array())
141
140
*/
142
141
public function getRoutesByNames ($ names , $ parameters = array ())
143
142
{
144
- $ routes = array ();
145
- if ('' === $ this ->idPrefix ) {
146
- $ routes = $ names ;
147
- } else {
148
- foreach ($ names as $ name ) {
149
- if (0 === strpos ($ name , $ this ->idPrefix )) {
150
- $ routes [] = $ name ;
143
+ if ('' !== $ this ->idPrefix ) {
144
+ foreach ($ names as $ key => $ name ) {
145
+ if (0 !== strpos ($ name , $ this ->idPrefix )) {
146
+ unset($ names [$ key ]);
151
147
}
152
148
}
153
149
}
154
150
155
- $ collection = $ this ->getObjectManager ()->findMany ($ this ->className , $ routes );
151
+ $ collection = $ this ->getObjectManager ()->findMany ($ this ->className , $ names );
156
152
foreach ($ collection as $ key => $ document ) {
157
153
if (!$ document instanceof SymfonyRoute) {
158
154
// we follow the logic of DocumentManager::findMany and do not throw an exception
You can’t perform that action at this time.
0 commit comments