]> Raphaël G. Git Repositories - airbundle/commitdiff
Shorten air bundle route alias
authorRaphaël Gertz <git@rapsys.eu>
Fri, 8 Mar 2024 00:34:38 +0000 (01:34 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Fri, 8 Mar 2024 00:34:38 +0000 (01:34 +0100)
Repository/DanceRepository.php
Repository/UserRepository.php

index 98a6ee9d8e6c2549c90bd31e4274c0f0c9228bed..251a1baa21913829941c783703a620248b93ab5b 100644 (file)
@@ -221,7 +221,7 @@ SQL;
                                        'id' => $id,
                                        'type' => $type = $this->translator->trans($name['types'][$k]),
                                        'slug' => $stype = $this->slugger->slug($type),
                                        'id' => $id,
                                        'type' => $type = $this->translator->trans($name['types'][$k]),
                                        'slug' => $stype = $this->slugger->slug($type),
-                                       'link' => $this->router->generate('rapsys_air_dance_view', ['id' => $id, 'name' => $slug, 'type' => $stype])
+                                       'link' => $this->router->generate('rapsysair_dance_view', ['id' => $id, 'name' => $slug, 'type' => $stype])
                                ];
                        }
 
                                ];
                        }
 
@@ -229,7 +229,7 @@ SQL;
                        $return[$sname = $this->slugger->short($name['name'])] = [
                                'name' => $tname,
                                'slug' => $slug,
                        $return[$sname = $this->slugger->short($name['name'])] = [
                                'name' => $tname,
                                'slug' => $slug,
-                               'link' => $this->router->generate('rapsys_air_dance_name', ['name' => $sname, 'dance' => $slug]),
+                               'link' => $this->router->generate('rapsysair_dance_name', ['name' => $sname, 'dance' => $slug]),
                                'types' => $types,
                                'modified' => $name['modified']
                        ];
                                'types' => $types,
                                'modified' => $name['modified']
                        ];
index 39185516d7f45c61d2e0a9129485cc6919766d52..4e7dae86cd8c3043418ac2972a89bf4980639c20 100644 (file)
@@ -275,7 +275,7 @@ SQL;
                $result['alternates'] = [];
 
                //Set route
                $result['alternates'] = [];
 
                //Set route
-               $route = 'rapsys_air_user_view';
+               $route = 'rapsysair_user_view';
 
                //Set route params
                $routeParams = ['id' => $id, 'user' => $this->slugger->slug($result['pseudonym'])];
 
                //Set route params
                $routeParams = ['id' => $id, 'user' => $this->slugger->slug($result['pseudonym'])];
@@ -283,7 +283,7 @@ SQL;
                //Milonga Raphaël exception
                if ($routeParams['id'] == 1 && $routeParams['user'] == 'milonga-raphael') {
                        //Set route
                //Milonga Raphaël exception
                if ($routeParams['id'] == 1 && $routeParams['user'] == 'milonga-raphael') {
                        //Set route
-                       $route = 'rapsys_air_user_milongaraphael';
+                       $route = 'rapsysair_user_milongaraphael';
                        //Set route params
                        $routeParams = [];
                }
                        //Set route params
                        $routeParams = [];
                }
@@ -473,8 +473,8 @@ SQL;
                                'dances' => [],
                                'slug' => $slug = $this->slugger->slug($data['pseudonym']),
                                //Milonga Raphaël exception
                                'dances' => [],
                                'slug' => $slug = $this->slugger->slug($data['pseudonym']),
                                //Milonga Raphaël exception
-                               'link' => $data['id'] == 1 && $slug == 'milonga-raphael' ? $this->router->generate('rapsys_air_user_milongaraphael', []) : $this->router->generate('rapsys_air_user_view', ['id' => $data['id'], 'user' => $slug]),
-                               'edit' => $this->router->generate('rapsys_user_edit', ['mail' => $short = $this->slugger->short($data['mail']), 'hash' => $this->slugger->hash($short)])
+                               'link' => $data['id'] == 1 && $slug == 'milonga-raphael' ? $this->router->generate('rapsysair_user_milongaraphael', []) : $this->router->generate('rapsysair_user_view', ['id' => $data['id'], 'user' => $slug]),
+                               'edit' => $this->router->generate('rapsysuser_edit', ['mail' => $short = $this->slugger->short($data['mail']), 'hash' => $this->slugger->hash($short)])
                        ];
 
                        //With dances
                        ];
 
                        //With dances
@@ -490,13 +490,13 @@ SQL;
                                        //Init dance when missing
                                        if (!isset($ret[$group][$data['id']]['dances'][$name = $this->translator->trans($names[$k])])) {
                                                $ret[$group][$data['id']]['dances'][$name] = [
                                        //Init dance when missing
                                        if (!isset($ret[$group][$data['id']]['dances'][$name = $this->translator->trans($names[$k])])) {
                                                $ret[$group][$data['id']]['dances'][$name] = [
-                                                       'link' => $this->router->generate('rapsys_air_dance_name', ['name' => $this->slugger->short($names[$k]), 'dance' => $this->slugger->slug($name)]),
+                                                       'link' => $this->router->generate('rapsysair_dance_name', ['name' => $this->slugger->short($names[$k]), 'dance' => $this->slugger->slug($name)]),
                                                        'types' => []
                                                ];
                                        }
 
                                        //Set type
                                                        'types' => []
                                                ];
                                        }
 
                                        //Set type
-                                       $ret[$group][$data['id']]['dances'][$name]['types'][$type = $this->translator->trans($types[$k])] = $this->router->generate('rapsys_air_dance_view', ['id' => $id, 'name' => $this->slugger->slug($name), 'type' => $this->slugger->slug($type)]);
+                                       $ret[$group][$data['id']]['dances'][$name]['types'][$type = $this->translator->trans($types[$k])] = $this->router->generate('rapsysair_dance_view', ['id' => $id, 'name' => $this->slugger->slug($name), 'type' => $this->slugger->slug($type)]);
                                }
                        }
                }
                                }
                        }
                }