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)
119119 */
120120 public function getRouteByName ($ name , $ parameters = array ())
121121 {
122-
123122 // $name is the route document path
124123 if ('' === $ this ->idPrefix || 0 === strpos ($ name , $ this ->idPrefix )) {
125124 $ route = $ this ->getObjectManager ()->find ($ this ->className , $ name );
@@ -141,18 +140,15 @@ public function getRouteByName($name, $parameters = array())
141140 */
142141 public function getRoutesByNames ($ names , $ parameters = array ())
143142 {
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 ]);
151147 }
152148 }
153149 }
154150
155- $ collection = $ this ->getObjectManager ()->findMany ($ this ->className , $ routes );
151+ $ collection = $ this ->getObjectManager ()->findMany ($ this ->className , $ names );
156152 foreach ($ collection as $ key => $ document ) {
157153 if (!$ document instanceof SymfonyRoute) {
158154 // 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